typing
Type hinting utils, defined and exposed for code readability purposes.
Batch = Tuple[Union[ArrayLike, List[ArrayLike]], Optional[Union[ArrayLike, List[ArrayLike]]], Optional[ArrayLike]]
module-attribute
Data batches specification type-annotation.
This type-hint designates (inputs, labels, weights) inputs, where:
- inputs and labels may be an array or a list of arrays;
- labels and/or weights may be None;
DataArray = Union[np.ndarray, pd.DataFrame, pd.Series, spmatrix]
module-attribute
Type-annotation alias for a union of data type structures.
This alias covers types supported by declearn.dataset.utils.save_data_array and its counterpart declearn.dataset.utils.load_data_array, and is hence used to annotate some dataset-interfacing tools under declearn.dataset.
SupportsConfig
Bases: Protocol
Protocol for type annotation of objects with get/from_config methods.
This class is primarily designed to be used for type annotation,
but may also be used to implement get_config
and from_config
the former of which requires overriding.
Source code in declearn/typing.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
from_config(config)
classmethod
Instantiate an object from its JSON-serializable config dict.
Source code in declearn/typing.py
73 74 75 76 77 78 79 |
|
get_config()
abstractmethod
Return a JSON-serializable config dict representing this object.
Source code in declearn/typing.py
68 69 70 71 |
|