public protocol RecurrentLayerCell: Layer
where
Input == RNNCellInput<TimeStepInput, State>,
Output == RNNCellOutput<TimeStepOutput, State>
A recurrent layer cell.
-
The input at a time step.
Declaration
associatedtype TimeStepInput : Differentiable where Self.Input == RNNCellInput<Self.TimeStepInput, Self.State>
-
The output at a time step.
Declaration
associatedtype TimeStepOutput : Differentiable where Self.Output == RNNCellOutput<Self.TimeStepOutput, Self.State>
-
The state that may be preserved across time steps.
Declaration
associatedtype State : Differentiable
-
Returns a zero-valued state with shape compatible with the provided input.
Declaration
func zeroState(for input: TimeStepInput) -> State
-
callAsFunction(input:state:)
Returns the new state obtained from applying the recurrent layer cell to the input at the current time step and the previous state.
Declaration
@differentiable public func callAsFunction( input: TimeStepInput, state: State ) -> RNNCellOutput<TimeStepOutput, State>
Parameters
timeStepInput
The input at the current time step.
previousState
The previous state of the recurrent layer cell.
Return Value
The output.
-
call(input:state:)
Declaration
@differentiable public func call(input: TimeStepInput, state: State) -> RNNCellOutput<TimeStepOutput, State>