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

add an example to update! #83

Merged
merged 2 commits into from
Jul 1, 2022
Merged

add an example to update! #83

merged 2 commits into from
Jul 1, 2022

Conversation

CarloLucibello
Copy link
Member

The update! docstring ends with the warning "However, you should not rely on the old model being fully updated." which maybe is a little unclear and vague.

I updated a bit the docstring and added an example. We could explain in which situation the old model won't be updated (scalar fields in a mutable struct?) if a simple explanation is available.

@mcabbott
Copy link
Member

mcabbott commented Jun 2, 2022

I made a suggestion below with attempt at demonstrating what it's doing. With a model where some arrays are immutable, you can see that the mutated original is only partly updated, and hence garbage.

I think that working through the struct Layer example here doesn't help much with understanding the difference between update and update!. But such things should be done somewhere, #84.

src/Optimisers.jl Outdated Show resolved Hide resolved
@mcabbott mcabbott requested a review from ToucheSir July 1, 2022 17:25
Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

LGTM

@mcabbott mcabbott merged commit a2c1b7d into master Jul 1, 2022
@mcabbott mcabbott deleted the CarloLucibello-patch-1 branch July 1, 2022 17:39
mcabbott added a commit that referenced this pull request Jul 1, 2022
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