Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Pathfinder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ export PathfinderResult, MultiPathfinderResult
export pathfinder, multipathfinder

const DEFAULT_HISTORY_LENGTH = 6
const DEFAULT_LINE_SEARCH = LineSearches.HagerZhang()
const DEFAULT_LINE_SEARCH_INIT = LineSearches.InitialHagerZhang()
const DEFAULT_LINE_SEARCH_CONSTRUCTOR = LineSearches.HagerZhang
const DEFAULT_LINE_SEARCH_INIT_CONSTRUCTOR = LineSearches.InitialHagerZhang
Comment on lines +27 to +28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the constant name and just make it the constructor instead of the object.

Suggested change
const DEFAULT_LINE_SEARCH_CONSTRUCTOR = LineSearches.HagerZhang
const DEFAULT_LINE_SEARCH_INIT_CONSTRUCTOR = LineSearches.InitialHagerZhang
const DEFAULT_LINE_SEARCH = LineSearches.HagerZhang
const DEFAULT_LINE_SEARCH_INIT = LineSearches.InitialHagerZhang

const DEFAULT_NDRAWS_ELBO = 5

function default_optimizer(history_length)
return Optim.LBFGS(;
m=history_length,
linesearch=DEFAULT_LINE_SEARCH,
alphaguess=DEFAULT_LINE_SEARCH_INIT,
linesearch=DEFAULT_LINE_SEARCH_CONSTRUCTOR(),
alphaguess=DEFAULT_LINE_SEARCH_INIT_CONSTRUCTOR(),
Comment on lines +34 to +35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
linesearch=DEFAULT_LINE_SEARCH_CONSTRUCTOR(),
alphaguess=DEFAULT_LINE_SEARCH_INIT_CONSTRUCTOR(),
linesearch=DEFAULT_LINE_SEARCH(),
alphaguess=DEFAULT_LINE_SEARCH_INIT(),

)
end

Expand Down
Loading