Update docs/src/models/basics.md

Co-Authored-By: Carlo Lucibello <carlo.lucibello@gmail.com>
This commit is contained in:
Dhairya Gandhi 2020-02-12 11:25:50 +05:30 committed by GitHub
parent 37d58e16dd
commit ee6d950696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ The first way of achieving this is through overloading the `trainable` function.
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: