Skip to content

Commit ccb54c6

Browse files
committed
updated recurrence.md
1 parent e7686b2 commit ccb54c6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/models/recurrence.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ An aspect to recognize is that in such model, the recurrent cells `A` all refer
1313
In the most basic RNN case, cell A could be defined by the following:
1414

1515
```julia
16-
Wxh = randn(5, 2)
17-
Whh = randn(5, 5)
18-
b = randn(5)
16+
Wxh = randn(Float32, 5, 2)
17+
Whh = randn(Float32, 5, 5)
18+
b = randn(Float32, 5)
1919

2020
function rnn(h, x)
2121
h = tanh.(Wxh * x .+ Whh * h .+ b)
2222
return h, h
2323
end
2424

25-
x = rand(2) # dummy data
26-
h = rand(5) # initial hidden state
25+
x = rand(Float32, 2) # dummy data
26+
h = rand(Float32, 5) # initial hidden state
2727

2828
h, y = rnn(h, x)
2929
```

0 commit comments

Comments
 (0)