Serialisation¤
feedbax.save
(
path
: str | Path
,
tree
: PyTree[eqx.Module]
,
hyperparameters
: Optional[dict] = None
)
->
None
¤
feedbax.save
(
path
: str | Path
,
tree
: PyTree[eqx.Module]
,
hyperparameters
: Optional[dict] = None
)
->
None
Save a PyTree to disk along with hyperparameters used to generate it.
Assumes none of the hyperparameters are JAX arrays, as these are not JSON serialisable.
Based on the Equinox serialisation example.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str | Path
|
The path of the file to be saved. Note that the file at this path will be overwritten if it exists. |
required |
tree |
PyTree[Module]
|
The PyTree to save. Its structure should match the return
type of a function |
required |
hyperparameters |
Optional[dict]
|
A dictionary of arguments for
|
None
|
feedbax.load
(
path
: Path | str
,
setup_func
: Callable[..., PyTree[Any, T]]
,
**kwargs
)
->
PyTree[Any, T]
¤
feedbax.load
(
path
: Path | str
,
setup_func
: Callable[..., PyTree[Any, T]]
,
**kwargs
)
->
PyTree[Any, T]
Setup a PyTree from stored data and hyperparameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path | str
|
The path of the file to be loaded. |
required |
setup_func |
Callable[..., PyTree[Any, T]]
|
A function that returns a PyTree of the same structure
as the PyTree that was saved to |
required |