Update docs/src/models/basics.md
Co-Authored-By: Carlo Lucibello <carlo.lucibello@gmail.com>
This commit is contained in:
parent
37d58e16dd
commit
ee6d950696
@ -228,7 +228,7 @@ The first way of achieving this is through overloading the `trainable` function.
|
|||||||
Flux.trainable(a::Affine) = (a.W, a.b,)
|
Flux.trainable(a::Affine) = (a.W, a.b,)
|
||||||
```
|
```
|
||||||
|
|
||||||
To add other fields is simply to add them to the tuple.
|
Only the fields returned by `trainable` will be collected as trainable parameters of the layer when calling `Flux.params`.
|
||||||
|
|
||||||
Another way of achieving this is through the `@functor` macro. Here, wee can mark the fields we are interested in like so:
|
Another way of achieving this is through the `@functor` macro. Here, wee can mark the fields we are interested in like so:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user