Algorithm Class#
- class evox.Algorithm[source]#
Base class for all algorithms
- __init__()#
- init(key=None, no_state=False, re_init=False)#
Initialize this module and all submodules
This method should not be overwritten.
- Parameters:
key (Array | None) – A PRNGKey.
no_state (bool)
re_init (bool)
- Returns:
The state of this module and all submodules combined.
- Return type:
- parallel_init(key, num_copies, no_state=False)#
Initialize multiple copies of this module in parallel
This method should not be overwritten.
- Parameters:
key (Array) – A PRNGKey.
num_copies (int) – The number of copies to be initialized
no_state (bool) – Whether to skip the state initialization
- Returns:
The state of this module and all submodules combined, and the last node_id
- Return type:
Tuple[State, int]
- setup(key)#
Setup mutable state here
The state it self is immutable, but it act as a mutable state by returning new state each time.
- Parameters:
key (Array) – A PRNGKey.
- Returns:
The state of this module.
- Return type: