mindscience.e3nn.o3.LinearBias

class mindscience.e3nn.o3.LinearBias(irreps_in, irreps_out, has_bias, ncon_dtype=mindspore.float32, **kwargs)[source]

Linear operation equivariant with option to add bias.

Equivalent to TensorProduct with instructions='linear' with option to add bias. For details, see mindscience.e3nn.o3.TensorProduct.

Parameters
  • irreps_in (Union[str, Irrep, Irreps]) – Irreps for the input.

  • irreps_out (Union[str, Irrep, Irreps]) – Irreps for the output.

  • has_bias (bool) – whether add bias to calculation.

  • ncon_dtype (mindspore.dtype, optional) – The type of input tensors of ncon computation module. Default: mindspore.float32.

Inputs:
  • v1 (Tensor): Input tensor. The shape of Tensor is \((..., 2l+1)\).

  • v2 (Tensor, optional): Input tensor. The shape of Tensor is \((..., 2l+1)\). Default: None.

  • weight (Tensor, optional): Weight tensor. The shape of Tensor is \((..., 2l+1)\). Default: None.

Outputs:
  • out (Tensor): Output tensor. The shape of Tensor is \((..., 2l+1)\).

Examples

>>> from mindscience.e3nn.o3 import LinearBias
>>> LinearBias('2x2e+3x1o+3x0e', '3x2e+5x1o+2x0e')
TensorProduct [linear] (2x2e+3x1o+3x0e x 1x0e -> 3x2e+5x1o+2x0e)