Linear Before Reset GRU
class LinearBeforeResetGRU(numInputs: Int, numHidden: Int, initialHidden: DTensor?, accType: RecurrentBase.RecurrentBase.AccType, xh2u: Dense, xh2r: Dense, x2n: Dense, h2n: Dense) : GRU
Content copied to clipboard
Linear-before-reset GRU
In the computation of the candidate activation vector, the linear transform is applied before the hidden state goes through the reset gate.
\hat{h}t = tanh(W_h x_t + b_1 + r_t * ( U_h h{t-1} + b_2))
As per version 1 of the the GRU paper (https://arxiv.org/abs/1406.1078v1), TODO: Hookup to DNNL like in v1.
Constructors
LinearBeforeResetGRU
Link copied to clipboard
fun LinearBeforeResetGRU(numInputs: Int, numHidden: Int, random: Random, initialHidden: DTensor? = null, acc: RecurrentBase.RecurrentBase.AccType = AccType.Fold)
Content copied to clipboard
LinearBeforeResetGRU
Link copied to clipboard
fun LinearBeforeResetGRU(numInputs: Int, numHidden: Int, initialHidden: DTensor? = null, accType: RecurrentBase.RecurrentBase.AccType = AccType.Fold, xh2u: Dense, xh2r: Dense, x2n: Dense, h2n: Dense)
Content copied to clipboard
Functions
do Recurrence
Link copied to clipboard
open fun doRecurrence(x: DTensor, initialState: DTensor = this.initialState): DTensor
Content copied to clipboard
Do the recurrence.
extract Tangent
Link copied to clipboard
open override fun extractTangent(output: DTensor, extractor: (DTensor, DTensor) -> DTensor): TrainableComponent.Companion.Tangent
Content copied to clipboard
get Single Input
Link copied to clipboard
Helper to check that the layer was called with a single input. Returns that input if successful, else errors.
load
Link copied to clipboard
process For Batching
Link copied to clipboard
store
Link copied to clipboard
training Step
Link copied to clipboard
open override fun trainingStep(optim: Optimizer<*>, tangent: Trainable.Tangent): GRU
Content copied to clipboard
with Trainables
Link copied to clipboard
Properties
accType
Link copied to clipboard
initialHidden
Link copied to clipboard
initialOutput
Link copied to clipboard
initialState
Link copied to clipboard
sequenceAxis
Link copied to clipboard
trainables
Link copied to clipboard