utils
Utilities for optimization.
Functions
Get the hparam with the given name. |
|
Check if the model is configurable. |
|
Check if the model is dynamic. |
|
Recursively yield the name and instance of all dynamic modules. |
|
Recursively yield the name and instance of all hparams. |
|
Return the size of the search space. |
- get_hparam(model, name)
Get the hparam with the given name.
- Parameters:
model (Module) –
name (str) –
- Return type:
- is_configurable(model)
Check if the model is configurable.
- Parameters:
model (Module) –
- Return type:
bool
- is_dynamic(model)
Check if the model is dynamic.
- Parameters:
model (Module) –
- Return type:
bool
- named_dynamic_modules(model)
Recursively yield the name and instance of all dynamic modules.
- Parameters:
model (Module) –
- Return type:
Generator[Tuple[str, DynamicModule], None, None]
- named_hparams(model, configurable=None)
Recursively yield the name and instance of all hparams.
- Parameters:
model (Module) –
configurable (bool | None) –
- Return type:
Generator[Tuple[str, Hparam], None, None]
- search_space_size(model)
Return the size of the search space.
- Parameters:
model (Module) –
- Return type:
int