File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ struct CustomModel
12
12
end
13
13
14
14
function (m:: CustomModel )(x)
15
- return m. chain (x) + x
16
-
17
- # You can put arbitrary code here, but note that everything here will be differentiated.
15
+ # Arbitrary code can go here, but note that everything will be differentiated.
18
16
# Zygote does not allow some operations, like mutating arrays.
17
+
18
+ return m. chain (x) + x
19
19
end
20
20
21
21
# Call @functor to allow for training. Described below in more detail.
@@ -30,6 +30,8 @@ model = CustomModel(chain)
30
30
model (rand (10 ))
31
31
```
32
32
33
+ For an intro to Flux and automatic differentiation, see this [ tutorial] ( https://fluxml.ai/tutorials/2020/09/15/deep-learning-flux.html )
34
+
33
35
## Customising Parameter Collection for a Model
34
36
35
37
Taking reference from our example ` Affine ` layer from the [ basics] ( basics.md#Building-Layers-1 ) .
You can’t perform that action at this time.
0 commit comments