Skip to content

Commit

Permalink
Merge pull request #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
```

2 comments on commit 6476a31

@CarloLucibello
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/58138

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.13.0 -m "<description of version>" 6476a314859f3e43fbf41c1857fd7b243cf07f21
git push origin v0.13.0

Please sign in to comment.