itwinai.serialization
- class itwinai.serialization.Serializable[source]
Bases:
object- parameters: Dict[Any, Any] = None
Dictionary storing constructor arguments. Needed to serialize the class to dictionary. Set by
self.save_parameters()method.
- save_parameters(**kwargs) None[source]
Simplified way to store constructor arguments in as class attributes. Keeps track of the parameters to enable YAML/JSON serialization.
- static locals2params(locals: Dict, pop_self: bool = True) Dict[source]
Remove
selffrom the output oflocals().- Parameters:
locals (Dict) – output of
locals()called in the constructor of a class.pop_self (bool, optional) – whether to remove
self. Defaults to True.
- Returns:
cleaned
locals().- Return type:
Dict
- class itwinai.serialization.ModelLoader(model_uri: str)[source]
Bases:
ABC,SerializableLoads a machine learning model from somewhere.