Skip to content

Commit

Permalink
Merge pull request FluxML#1933 from prbzrg/fix-code-block
Browse files Browse the repository at this point in the history
Fix a code block
  • Loading branch information
CarloLucibello authored Apr 7, 2022
2 parents 674527e + df1a78c commit 6476a31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/saving.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ versions of Flux).
Saving models this way will only store the trainable parameters which
will result in incorrect behavior for layers like `BatchNorm`.

```Julia
```julia
julia> using Flux

julia> model = Chain(Dense(10 => 5,relu),Dense(5 => 2),softmax)
Chain(Dense(10, 5, NNlib.relu), Dense(5, 2), NNlib.softmax)

julia> weights = Flux.params(model);
```

Loading the model as shown above will return a new model with the stored parameters.
But sometimes you already have a model, and you want to load stored parameters into it.
Expand Down Expand Up @@ -127,4 +128,3 @@ exactly where you left off. BSON is smart enough to [cache values](https://githu
opt = ADAM()
@save "model-$(now()).bson" model opt
```

0 comments on commit 6476a31

Please sign in to comment.