NEML2 2.0.0
Loading...
Searching...
No Matches
Model Class Reference

Detailed Description

A thin wrapper around neml2::Model

Public Member Functions

TensorValue __getattr__ (self, str arg0)
 
None __setattr__ (self, str arg0, tensors.Tensor arg1)
 
str __str__ (self)
 
dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]] d2value (self, dict arg0)
 
dict[str, Modeldependency (self)
 
dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]] dvalue (self, dict arg0)
 
tuple[dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]]] dvalue_and_d2value (self, dict arg0)
 
TensorValue get_parameter (self, str arg0)
 
LabeledAxis input_axis (self)
 
tensors.TensorType input_type (self, LabeledAxisAccessor variable)
 
dict[str, TensorValuenamed_buffers (self)
 
dict[str, TensorValuenamed_parameters (self)
 
dict[str, Modelnamed_submodels (self)
 
LabeledAxis output_axis (self)
 
tensors.TensorType output_type (self, LabeledAxisAccessor variable)
 
None set_parameter (self, str arg0, tensors.Tensor arg1)
 
None set_parameters (self, dict[str, tensors.Tensor] arg0)
 
None to (self, *torch.dtype dtype=..., torch.device device=..., bool requires_grad=False)
 
dict[LabeledAxisAccessor, tensors.Tensorvalue (self, dict arg0)
 
tuple[dict[LabeledAxisAccessor, tensors.Tensor], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]] value_and_dvalue (self, dict arg0)
 
tuple[dict[LabeledAxisAccessor, tensors.Tensor], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]]] value_and_dvalue_and_d2value (self, dict arg0)
 
str name (self)
 
str type (self)
 

Member Function Documentation

◆ __getattr__()

TensorValue __getattr__ ( self,
str arg0 )
Get a model parameter given its name

◆ __setattr__()

None __setattr__ ( self,
str arg0,
tensors.Tensor arg1 )
Set the value for a model parameter

◆ __str__()

str __str__ ( self)

◆ d2value()

dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]] d2value ( self,
dict arg0 )

◆ dependency()

dict[str, Model] dependency ( self)
Get the dictionary describing this model's dependency information, if any.

◆ dvalue()

dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]] dvalue ( self,
dict arg0 )

◆ dvalue_and_d2value()

tuple[dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]]] dvalue_and_d2value ( self,
dict arg0 )

◆ get_parameter()

TensorValue get_parameter ( self,
str arg0 )
Get a model parameter given its name

◆ input_axis()

LabeledAxis input_axis ( self)
Input axis of the model. The axis contains information on variable names and their associated slicing indices.

◆ input_type()

tensors.TensorType input_type ( self,
LabeledAxisAccessor variable )
Introspect the underlying tensor type of an input variable. @returns tensors.TensorType

◆ name()

str name ( self)
Name of the model

◆ named_buffers()

dict[str, TensorValue] named_buffers ( self)
Get the model buffers. The keys of the returned dictionary are the buffers' names.

◆ named_parameters()

dict[str, TensorValue] named_parameters ( self)
Get the model parameters. The keys of the returned dictionary are the parameters' names.

◆ named_submodels()

dict[str, Model] named_submodels ( self)
Get the sub-models registered to this model

◆ output_axis()

LabeledAxis output_axis ( self)
Input axis of the model. The axis contains information on variable names and their associated slicing indices.

◆ output_type()

tensors.TensorType output_type ( self,
LabeledAxisAccessor variable )
Introspect the underlying tensor type of an output variable. @returns tensors.TensorType

◆ set_parameter()

None set_parameter ( self,
str arg0,
tensors.Tensor arg1 )
Set the value for a model parameter

◆ set_parameters()

None set_parameters ( self,
dict[str, tensors.Tensor] arg0 )
Set the values for multiple model parameters

◆ to()

None to ( self,
*torch.dtype dtype = ...,
torch.device device = ...,
bool requires_grad = False )

◆ type()

str type ( self)
Type of the model

◆ value()

dict[LabeledAxisAccessor, tensors.Tensor] value ( self,
dict arg0 )

◆ value_and_dvalue()

tuple[dict[LabeledAxisAccessor, tensors.Tensor], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]] value_and_dvalue ( self,
dict arg0 )

◆ value_and_dvalue_and_d2value()

tuple[dict[LabeledAxisAccessor, tensors.Tensor], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]], dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, dict[LabeledAxisAccessor, tensors.Tensor]]]] value_and_dvalue_and_d2value ( self,
dict arg0 )