commit
c565317d9e
@ -31,8 +31,8 @@ Flux has powerful high-level features, and common architectures can be defined i
|
|||||||
```julia
|
```julia
|
||||||
model = Chain(
|
model = Chain(
|
||||||
Dense(768, 128, σ),
|
Dense(768, 128, σ),
|
||||||
LSTM(128, 256)
|
LSTM(128, 256),
|
||||||
LSTM(256, 128)
|
LSTM(256, 128),
|
||||||
Dense(128, 10),
|
Dense(128, 10),
|
||||||
softmax)
|
softmax)
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ linear2 = linear(3, 2)
|
|||||||
|
|
||||||
model(x) = linear2(σ.(linear1(x)))
|
model(x) = linear2(σ.(linear1(x)))
|
||||||
|
|
||||||
model(x) # => 2-element vector
|
model(rand(5)) # => 2-element vector
|
||||||
```
|
```
|
||||||
|
|
||||||
Another (equivalent) way is to create a struct that explicitly represents the affine layer.
|
Another (equivalent) way is to create a struct that explicitly represents the affine layer.
|
||||||
|
Loading…
Reference in New Issue
Block a user