declearn.utils.ObjectConfig
Dataclass to wrap a JSON-serializable object configuration.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Key to retrieve the object's type constructor, typically from
registered types (see |
group |
str or None
|
Optional name of the group under which the object's type is
registered (see |
config |
dict[str, any]
|
JSON-serializable dict containing the object's config, that
enables recreating it using |
Source code in declearn/utils/_serialize.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
from_json(path)
classmethod
Restore an ObjectConfig from a JSON file.
Source code in declearn/utils/_serialize.py
75 76 77 78 79 |
|
to_dict()
Return a dict representation of this ObjectConfig.
Source code in declearn/utils/_serialize.py
67 68 69 |
|
to_json(path)
Save this ObjectConfig to a JSON file.
Source code in declearn/utils/_serialize.py
71 72 73 |
|