ngraph.opset7.gru_cell

ngraph.opset7.gru_cell(X: Union[_pyngraph.Node, int, float, numpy.ndarray], initial_hidden_state: Union[_pyngraph.Node, int, float, numpy.ndarray], W: Union[_pyngraph.Node, int, float, numpy.ndarray], R: Union[_pyngraph.Node, int, float, numpy.ndarray], B: Union[_pyngraph.Node, int, float, numpy.ndarray], hidden_size: int, activations: List[str] = None, activations_alpha: List[float] = None, activations_beta: List[float] = None, clip: float = 0.0, linear_before_reset: bool = False, name: Optional[str] = None) _pyngraph.Node

Perform GRUCell operation on the tensor from input node.

GRUCell represents a single GRU Cell that computes the output using the formula described in the paper: https://arxiv.org/abs/1406.1078

Note this class represents only single cell and not whole layer.

Parameters
  • X – The input tensor with shape: [batch_size, input_size].

  • initial_hidden_state – The hidden state tensor at current time step with shape: [batch_size, hidden_size].

  • W – The weights for matrix multiplication, gate order: zrh. Shape: [3*hidden_size, input_size].

  • R – The recurrence weights for matrix multiplication. Shape: [3*hidden_size, hidden_size].

  • B – The sum of biases (weight and recurrence). For linear_before_reset set True the shape is [4*hidden_size]. Otherwise the shape is [3*hidden_size].

  • hidden_size – The number of hidden units for recurrent cell. Specifies hidden state size.

  • activations – The vector of activation functions used inside recurrent cell.

  • activation_alpha – The vector of alpha parameters for activation functions in order respective to activation list.

  • activation_beta – The vector of beta parameters for activation functions in order respective to activation list.

  • clip – The value defining clipping range [-clip, clip] on input of activation functions.

  • linear_before_reset – Flag denotes if the layer behaves according to the modification of GRUCell described in the formula in the ONNX documentation.

  • name – Optional output node name.

Returns

The new node performing a GRUCell operation on tensor from input node.