Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit cfefd63

Browse files
Shashi456rxwei
authored andcommitted
Adding Tanh to RNN Cell (#103)
1 parent b904e70 commit cfefd63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/DeepLearning/Layer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ public struct SimpleRNNCell<Scalar: TensorFlowFloatingPoint>: RNNCell {
13201320
@differentiable
13211321
public func call(_ input: Input) -> Output {
13221322
let concatenatedInput = input.input.concatenated(with: input.state, alongAxis: 1)
1323-
let newState = matmul(concatenatedInput, weight) + bias
1323+
let newState = tanh(matmul(concatenatedInput, weight) + bias)
13241324
return Output(output: newState, state: newState)
13251325
}
13261326
}

0 commit comments

Comments
 (0)