Skip to content

Commit 9b6000a

Browse files
committed
updated recurrence.md
1 parent ccb54c6 commit 9b6000a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/models/recurrence.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Wxh = randn(Float32, 5, 2)
1717
Whh = randn(Float32, 5, 5)
1818
b = randn(Float32, 5)
1919

20-
function rnn(h, x)
21-
h = tanh.(Wxh * x .+ Whh * h .+ b)
22-
return h, h
20+
function rnn_cell(h, x)
21+
h = tanh.(Wxh * x .+ Whh * h .+ b)
22+
return h, h
2323
end
2424

2525
x = rand(Float32, 2) # dummy data
2626
h = rand(Float32, 5) # initial hidden state
2727

28-
h, y = rnn(h, x)
28+
h, y = rnn_cell(h, x)
2929
```
3030

3131
Notice how the above is essentially a `Dense` layer that acts on two inputs, `h` and `x`.

0 commit comments

Comments
 (0)