neml2.pyzag#
- class neml2.pyzag.NEML2PyzagModel(sys, *args, exclude_parameters=None, include_parameters=None, **kwargs)[source]#
Bases:
NonlinearRecursiveFunctionWrap a native NEML2
NonlinearSystemas a pyzagNonlinearRecursiveFunction.- Parameters:
sys (ModelNonlinearSystem) – the native NEML2 nonlinear system to wrap.
- Keyword Arguments:
exclude_parameters (list of str) – NEML2 parameters to not mirror as torch parameters on the wrapper (so every other parameter is trained). Mutually exclusive with
include_parameters.include_parameters (list of str) – the only NEML2 parameters to mirror as torch parameters on the wrapper (so every other parameter is held fixed). Mutually exclusive with
exclude_parameters.
exclude_parametersandinclude_parametersare both optional and mutually exclusive: omit both to train every parameter, passexclude_parametersto train all-but-some, or passinclude_parametersto train only-these. Passing both raisesValueError.Additional
argsandkwargsare forwarded totorch.nn.Moduleverbatim.
- neml2.pyzag.change_lag_order(var, new_order)[source]#
Re-tag a variable name to a different lag order. Inverse of
lag_order().