Utilities

Module contents

exception olympus.utils.CircularDependencies[source]

Bases: Exception

class olympus.utils.HyperParameters(space, **kwargs)[source]

Bases: object

Keeps track of mandatory hyper parameters

Parameters:
space: Dict[str, Space]

A dictionary defining each parameters and their respective space/dim

kwargs:

A dictionary of defined hyper parameters

Methods

add_parameters  
check_correct_parameters  
missing_parameters  
parameters  
add_parameters(self, **kwargs)[source]
check_correct_parameters(self, kwargs)[source]
missing_parameters(self)[source]
parameters(self, strict=False)[source]
class olympus.utils.LazyCall(fun, *args, **kwargs)[source]

Bases: object

Save the call parameters of a function for it can be invoked at a later date

Methods

__call__(self, \*args, \*\*kwargs) Call self as a function.
add_arguments  
invoke  
was_invoked  
add_arguments(self, *args, **kwargs)[source]
invoke(self, **kwargs)[source]
was_invoked(self)[source]
exception olympus.utils.MissingArgument[source]

Bases: Exception

exception olympus.utils.MissingParameters[source]

Bases: Exception

class olympus.utils.TimeThrottler(fun: Callable[[A], R], every=10)[source]

Bases: object

Limit how often the function fun is called in seconds

Methods

__call__(self, \*args, \*\*kwargs) Call self as a function.
exception olympus.utils.WrongParameter[source]

Bases: Exception

olympus.utils.fetch_device()[source]

Set the default device to CPU if cuda is not available

olympus.utils.find_batch_size(model, shape, low, high, dtype=torch.float32)[source]

Find the highest batch size that can fit in memory using binary search

olympus.utils.get_seeds()[source]
olympus.utils.get_storage(uri, objective=None)[source]

Shorten the storage config from orion that is super long an super confusing <storage_type>:<database>:<file or address>

legacy:pickleddb:my_data.pkl legacy:mongodb://user@pass:192.168.0.0:8989

olympus.utils.get_value(item)[source]
olympus.utils.new_seed(**kwargs)[source]

Global seed management

olympus.utils.parse_uri(uri)[source]
olympus.utils.parse_uri_options(options)[source]
olympus.utils.set_seeds(seed)[source]
olympus.utils.show_dict(dictionary, indent=0)[source]