Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend setup docstring to show custom struct #85

Merged
merged 3 commits into from
Jun 3, 2022

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Jun 2, 2022

For #84

src/Optimisers.jl Outdated Show resolved Hide resolved
julia> Optimisers.setup(Momentum(), model)
(lay = (mat = Leaf(Momentum{Float32}(0.01, 0.9), [0.0 0.0; 0.0 0.0]), vec = Leaf(Momentum{Float32}(0.01, 0.9), [0.0, 0.0])), fun = nothing)

julia> Optimisers.trainable(l::Layer) = (vec = l.vec,) # if necessary, ignore some parameters
Copy link
Member

Choose a reason for hiding this comment

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

My inclination is that we'd want a motivating example where @functor Layer (vec,) is not sufficient. The counter-argument would be that 99% of @functor use should not specify a list of properties because users may want to traverse to them with fmap and friends.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe best to leave this off here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@mcabbott mcabbott merged commit 5d3d741 into FluxML:master Jun 3, 2022
@mcabbott mcabbott deleted the doc_functor branch June 3, 2022 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants