gluonts.mx.block.snmlp module#

class gluonts.mx.block.snmlp.SNMLPBlock(in_units: int, hidden_units: int, out_units: int, num_hidden_layers: int = 2, activation: str = 'lipswish', jacobian_method: str = 'bf', num_power_iter: int = 1, coeff: float = 0.9, flatten: bool = False)[source]#

Bases: mxnet.gluon.block.HybridBlock

get_weights()[source]#
hybrid_forward(F, x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#
Parameters

x – Input Tensor

Returns

output of SNMLPBlock

Return type

Tensor

jacobian(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#
Parameters

x – Input Tensor

Returns

Jacobian of the SNMLPBlock evaluated at x.

Return type

Tensor

gluonts.mx.block.snmlp.jacobian_sn_mlp_block_bf(layers: List[Tuple[mxnet.gluon.block.HybridBlock, Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]]]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#

Brute force computation of the jacobian of a SNMlpBlock jac is of shape (Batch dim1, …, Output dim, Input dim)

Parameters

layers – A list of tuples where each tuple (layer, input) is associated to a composing layer of the SNMLPBlock, where layer corresponds to the associated object layer, along with its input tensor.

Returns

Jacobian of the SNMLPBlock computed at a given input

Return type

Tensor