File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,14 @@ maywrite(_) = false
147
147
"""
148
148
trainable(x::Layer) -> NamedTuple
149
149
150
- This should be overloaded to make optimisers ignore some fields of
150
+ This may be overloaded to make optimisers ignore some fields of
151
151
every `Layer`, which would otherwise contain trainable parameters.
152
- (Elements such as functions and sizes are always ignored.)
152
+
153
+ !!! warning
154
+ This is very rarely required. Fields of `struct Layer` which contain
155
+ functions, or integers like sizes, are always ignored anyway.
156
+ Overloading `trainable` is only necessary when some arrays of numbers
157
+ are to be optimised, and some arrays of numbers are not.
153
158
154
159
The default is `Functors.children(x)`, usually a NamedTuple of all fields,
155
160
and `trainable(x)` must contain a subset of these.
You can’t perform that action at this time.
0 commit comments