Skip to content

Commit 878b39c

Browse files
authored
Merge pull request #1762 from NightMachinary/doc1
Doc update (saving.md): removed outdated info; Typo fix.
2 parents e8a67b4 + 3207000 commit 878b39c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ One of the best ways to contribute is by looking at issues labeled ["help wanted
88

99
## Good First Issues
1010

11-
While there are not many right now, we do have a section for ["good for issues"](https://github.com/FluxML/Flux.jl/labels/good%20first%20issue). As mentioned above, if any of these seem interesting but there is no clear next step in your mind, please feel free to ask for a suggested step. Often times in open source, issues labeled as "good first issue" actually take some back and forth between maintainers and contributors before the issues is ready to be tackled by a new contributor.
11+
While there are not many right now, we do have a section for ["good first issues"](https://github.com/FluxML/Flux.jl/labels/good%20first%20issue). As mentioned above, if any of these seem interesting but there is no clear next step in your mind, please feel free to ask for a suggested step. Often times in open source, issues labeled as "good first issue" actually take some back and forth between maintainers and contributors before the issues is ready to be tackled by a new contributor.
1212

1313
## Model Zoo
1414

docs/src/saving.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@ revert to an older copy of the model if it starts to overfit.
118118
@save "model-$(now()).bson" model loss = testloss()
119119
```
120120

121-
You can even store optimiser state alongside the model, to resume training
122-
exactly where you left off.
121+
Note that to resume a model's training, you might need to restore other stateful parts of your training loop. Possible examples are stateful optimizers (which usually utilize an `IdDict` to store their state), and the randomness used to partition the original data into the training and validation sets.
122+
123+
You can store the optimiser state alongside the model, to resume training
124+
exactly where you left off. BSON is smart enough to [cache values](https://github.com/JuliaIO/BSON.jl/blob/v0.3.4/src/write.jl#L71) and insert links when saving, but only if it knows everything to be saved up front. Thus models and optimizers must be saved together to have the latter work after restoring.
123125

124126
```julia
125127
opt = ADAM()
126128
@save "model-$(now()).bson" model opt
127129
```
130+

0 commit comments

Comments
 (0)