You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most basic recurrent layer; essentially acts as a `Dense` layer, but with the
125
125
output fed back into the input each time step.
126
126
127
-
The parameters `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
127
+
The arguments `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
128
128
129
129
This constructor is syntactic sugar for `Recur(RNNCell(a...))`, and so RNNs are stateful. Note that the state shape can change depending on the inputs, and so it is good to `reset!` the model between inference calls if the batch size changes. See the examples below.
130
130
131
131
# Examples
132
132
```jldoctest
133
-
julia> r = RNN(3, 5)
133
+
julia> r = RNN(3 => 5)
134
134
Recur(
135
-
RNNCell(3, 5, tanh), # 50 parameters
135
+
RNNCell(3 => 5, tanh), # 50 parameters
136
136
) # Total: 4 trainable arrays, 50 parameters,
137
137
# plus 1 non-trainable, 5 parameters, summarysize 432 bytes.
[Long Short Term Memory](https://www.researchgate.net/publication/13853244_Long_Short-term_Memory)
217
217
recurrent layer. Behaves like an RNN but generally exhibits a longer memory span over sequences.
218
218
219
-
The parameters `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
219
+
The arguments `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
220
220
221
221
This constructor is syntactic sugar for `Recur(LSTMCell(a...))`, and so LSTMs are stateful. Note that the state shape can change depending on the inputs, and so it is good to `reset!` the model between inference calls if the batch size changes. See the examples below.
222
222
@@ -225,9 +225,9 @@ for a good overview of the internals.
225
225
226
226
# Examples
227
227
```jldoctest
228
-
julia> l = LSTM(3, 5)
228
+
julia> l = LSTM(3 => 5)
229
229
Recur(
230
-
LSTMCell(3, 5), # 190 parameters
230
+
LSTMCell(3 => 5), # 190 parameters
231
231
) # Total: 5 trainable arrays, 190 parameters,
232
232
# plus 2 non-trainable, 10 parameters, summarysize 1.062 KiB.
[Gated Recurrent Unit](https://arxiv.org/abs/1406.1078v1) layer. Behaves like an
285
285
RNN but generally exhibits a longer memory span over sequences. This implements
286
286
the variant proposed in v1 of the referenced paper.
287
287
288
-
The parameters `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
288
+
The integer arguments `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
289
289
290
290
This constructor is syntactic sugar for `Recur(GRUCell(a...))`, and so GRUs are stateful. Note that the state shape can change depending on the inputs, and so it is good to `reset!` the model between inference calls if the batch size changes. See the examples below.
291
291
@@ -294,9 +294,9 @@ for a good overview of the internals.
294
294
295
295
# Examples
296
296
```jldoctest
297
-
julia> g = GRU(3, 5)
297
+
julia> g = GRU(3 => 5)
298
298
Recur(
299
-
GRUCell(3, 5), # 140 parameters
299
+
GRUCell(3 => 5), # 140 parameters
300
300
) # Total: 4 trainable arrays, 140 parameters,
301
301
# plus 1 non-trainable, 5 parameters, summarysize 792 bytes.
[Gated Recurrent Unit](https://arxiv.org/abs/1406.1078v3) layer. Behaves like an
350
350
RNN but generally exhibits a longer memory span over sequences. This implements
351
351
the variant proposed in v3 of the referenced paper.
352
352
353
-
The parameters `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
353
+
The arguments `in` and `out` describe the size of the feature vectors passed as input and as output. That is, it accepts a vector of length `in` or a batch of vectors represented as a `in x B` matrix and outputs a vector of length `out` or a batch of vectors of size `out x B`.
354
354
355
355
This constructor is syntactic sugar for `Recur(GRUv3Cell(a...))`, and so GRUv3s are stateful. Note that the state shape can change depending on the inputs, and so it is good to `reset!` the model between inference calls if the batch size changes. See the examples below.
356
356
@@ -359,9 +359,9 @@ for a good overview of the internals.
359
359
360
360
# Examples
361
361
```jldoctest
362
-
julia> g = GRUv3(3, 5)
362
+
julia> g = GRUv3(3 => 5)
363
363
Recur(
364
-
GRUv3Cell(3, 5), # 140 parameters
364
+
GRUv3Cell(3 => 5), # 140 parameters
365
365
) # Total: 5 trainable arrays, 140 parameters,
366
366
# plus 1 non-trainable, 5 parameters, summarysize 848 bytes.
0 commit comments