Update docs/src/models/basics.md
Co-Authored-By: Carlo Lucibello <carlo.lucibello@gmail.com>
This commit is contained in:
parent
ee6d950696
commit
d5ed9a4478
|
@ -231,7 +231,7 @@ Flux.trainable(a::Affine) = (a.W, a.b,)
|
||||||
Only the fields returned by `trainable` will be collected as trainable parameters of the layer when calling `Flux.params`.
|
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:
|
||||||
|
Another way of achieving this is through the `@functor` macro. Here, we can mark the fields we are interested in by grouping them in the second argument:
|
||||||
```julia
|
```julia
|
||||||
Flux.@functor Affine (W,)
|
Flux.@functor Affine (W,)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue