Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Printer reports NaNs with GradientDescent #11

Closed
vladimir-ch opened this issue Nov 20, 2014 · 0 comments · Fixed by #20
Closed

Printer reports NaNs with GradientDescent #11

vladimir-ch opened this issue Nov 20, 2014 · 0 comments · Fixed by #20
Labels

Comments

@vladimir-ch
Copy link
Member

Default Printer reports NaNs as objective function values when GradientDescent is used and every iteration printer. The reason is that Backtracking requires only FunctionEval, so when the step is finished, GradientEval is requested. evaluate() for this evalType puts math.NaN() into location.F unconditionally (original location.F is then restored back by Backtracking).

One option would be to test if xNext is different from location.X and put NaN into location.F only if it is. However, this implies extra work when Dim is large. Any other options?

vladimir-ch added a commit that referenced this issue Dec 11, 2014
local.go:evaluate() puts unconditionally a NaN in location.F if
GradientEval is requested, or into location.Gradient if FunctionEval is
requested. This may cause some issues especially in Recorders.
Therefore, use NaNs only if location.X and xNext are different.

Fixes #11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant