Skip to content

Conversation

zuhengxu
Copy link
Member

@zuhengxu zuhengxu commented Jul 11, 2023

@zuhengxu zuhengxu marked this pull request as draft July 11, 2023 06:33
@zuhengxu zuhengxu requested review from torfjelde and sunxd3 July 13, 2023 05:04
@zuhengxu zuhengxu self-assigned this Jul 13, 2023
@zuhengxu zuhengxu added the enhancement New feature or request label Jul 13, 2023
@zuhengxu zuhengxu marked this pull request as ready for review July 13, 2023 14:43
@sunxd3
Copy link
Member

sunxd3 commented Jul 19, 2023

@torfjelde Any opinion on hasconverged interface?

Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

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

Great work @zuhengxu :)

I've added some minor changes, but feel free to merge when that has been addressed.

src/train.jl Outdated

# return status of the optimiser for potential continuation of training
return θ, map(identity, opt_stats), st
return θ, map(identity, opt_stats[1:(i - 1)]), st
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
return θ, map(identity, opt_stats[1:(i - 1)]), st
return θ, map(identity, opt_stats), st

Copy link
Member

Choose a reason for hiding this comment

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

And just make opt_stats = [] and push!(opt_stats, stat) above (I can't make a suggestion to code that doesn't show up in the diff).

using ..ReverseDiff
end

# ReverseDiff without compiled tape
Copy link
Member

Choose a reason for hiding this comment

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

We could probably support compilation of the tape using some shenanigans with Memoize.jl or something (to avoid compile re-compiling the tape on every call to value_and_gradient).

But let's not bother with this for now 👍 Maybe make an issue to keep track of it or smth?

Co-authored-by: Tor Erlend Fjelde <tor.github@gmail.com>
@zuhengxu zuhengxu merged commit ab46270 into TuringLang:main Aug 3, 2023
Comment on lines +15 to +19
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[weakdeps]
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
Copy link
Member

Choose a reason for hiding this comment

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

It seems compat entries for Enzyme and Requires are missing - I think this has to be fixed before tagging a release (packages with missing compat entries can't be added to the general registry IIRC).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Yeah, I always forget adding compat entries for denpencies. Will include those in next PR (should be merged soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants