nnopinf.operators.LinearAffineSkewTensorOperator#
- class nnopinf.operators.LinearAffineSkewTensorOperator(acts_on, depends_on, skew=True, name='LinearAffineSkewTensorOperator')[source]#
Bases:
Module\(f: (v,x) \mapsto [S_{ijk} - S_{jik}] x_k v_k\)
Constructs a linear affine skew-symmetric tensor operator
- Parameters:
acts_on (nnopinf.Variable) – The state the operator acts on, i.e., the \(x\)
depends_on (tuple of nnopinf.Variable) – The affine variables the operator depends on, i.e., the \(v\)
- skewbool
Constructs a skew-symmetric operator if true, constructs a symmetric operator if false
- namestring
Operator name. Used when saving to file
- forward(inputs, return_jacobian=False)[source]#
Forward pass of operator
Warning
return_jacobian is currently not implemented
- 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.
- set_scalings(input_scalings_dict, output_scaling)[source]#
Store input, state, and output scaling factors for the affine skew operator.
- Parameters:
input_scalings_dict (dict) – Mapping from variable name to the corresponding feature-wise input scaling vector.
output_scaling (tensor-like) – Feature-wise scaling vector for the operator output.