hive.utils.utils module

hive.utils.utils.create_folder(folder)[source]

Creates a folder.

Parameters

folder (str) – Folder to create.

class hive.utils.utils.Seeder[source]

Bases: object

Class used to manage seeding in RLHive. It sets the seed for all the frameworks that RLHive currently uses. It also deterministically provides new seeds based on the global seed, in case any other objects in RLHive (such as the agents) need their own seed.

set_global_seed(seed)[source]

This reduces some sources of randomness in experiments. To get reproducible results, you must run on the same machine and set the environment variable CUBLAS_WORKSPACE_CONFIG to “:4096:8” or “:16:8” before starting the experiment.

Parameters

seed (int) – Global seed.

get_new_seed()[source]

Each time it is called, it increments the current_seed and returns it.

class hive.utils.utils.Chomp[source]

Bases: dict

An extension of the dictionary class that allows for accessing through dot notation and easy saving/loading.

save(filename)[source]

Saves the object using pickle.

Parameters

filename (str) – Filename to save object.

load(filename)[source]

Loads the object.

Parameters

filename (str) – Where to load object from.

class hive.utils.utils.OptimizerFn(fn)[source]

Bases: CallableType

A wrapper for callables that produce optimizer functions.

These wrapped callables can be partially initialized through configuration files or command line arguments.

Parameters

fn – callable to be wrapped.

classmethod type_name()[source]
Returns

“optimizer_fn”

class hive.utils.utils.LossFn(fn)[source]

Bases: CallableType

A wrapper for callables that produce loss functions.

These wrapped callables can be partially initialized through configuration files or command line arguments.

Parameters

fn – callable to be wrapped.

classmethod type_name()[source]
Returns

“loss_fn”