gluonts.mx.activation module

class gluonts.mx.activation.LipSwish(beta_initializer: mxnet.initializer.Initializer = <mxnet.initializer.Constant object>, **kwargs)[source]

Bases: mxnet.gluon.block.HybridBlock

Implemented LipSwish activation, i.e. LipSwish(z) := Swish(z)/ 1.1 with a learnable parameter beta.

hybrid_forward(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], beta: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]
Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • x – Input tensor

  • beta – beta parameter of activation

Returns

output of forward

Return type

Tensor

gluonts.mx.activation.deriv_elu(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], alpha: float = 1.0) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Derivative function of Elu activation computed at point x.

Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • x – Input tensor

  • alpha – alpha parameter of Elu

Returns

Derivative tensor

Return type

Tensor

gluonts.mx.activation.deriv_lipswish(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], beta: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Derivative function of LipSwish activation computed at point x. :param F: A module that can either refer to the Symbol API or the NDArray API in MXNet. :param x: Input tensor :param beta: beta parameter in LipSwish activation

Returns

Derivative tensor

Return type

Tensor

gluonts.mx.activation.deriv_softrelu(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Derivative function of SoftRelu activation computed at point x.

Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • x – Input tensor

Returns

Derivative tensor

Return type

Tensor

gluonts.mx.activation.deriv_swish(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], beta: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Derivative function of Swish activation computed at point x.

Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • x – Input tensor

  • beta – beta parameter of LipSwish

Returns

Derivative tensor

Return type

Tensor

gluonts.mx.activation.deriv_tanh(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Derivative function of Tanh activation computed at point x.

Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • x – Input tensor

Returns

Derivative tensor

Return type

Tensor

gluonts.mx.activation.get_activation(activation: str, **kwargs) → mxnet.gluon.block.HybridBlock[source]
Parameters

activation – Activation type

Returns

Activation object

Return type

mxnet.gluon.HybridBlock

gluonts.mx.activation.get_activation_deriv(act: mxnet.gluon.block.HybridBlock) → Callable[source]
Parameters

act – Activation object

Returns

Derivative function of associated activation

Return type

Callable