nnopinf.operators.LinearAffineTensorOperator#

class nnopinf.operators.LinearAffineTensorOperator(n_outputs, acts_on, depends_on, name='LinearAffineTensorOperator')[source]#

Bases: Module

\(f: (v,x) \mapsto A_{ijk} x_k v_k\)

Constructs a linear affine tensor operator

Parameters:
  • n_outputs (int) – Output dimension of the operator, i.e., M in the above description

  • acts_on (nnopinf.Variable) – The state the operators acts on, i.e., the \(x\)

  • depends_on (tuple of nnopinf.Variable) – The affine variables the operator depends on, i.e., the \(v\)

  • name (string) – Operator name. Used when saving to file

forward(inputs, return_jacobian=False)[source]#

Forward pass of operator

Parameters:
  • inputs (dict(str, np.array)) – Dictionary of input data in the form of arrays referenced by the variable name, i.e., inputs[‘x’] = np.ones(3)

  • return_jacobian (bool, optional) – If True, return the (approximate) Jacobian in addition to the output.