utils module

Auxiliary module with simple utility and informative functions.

utils.dict_to_str(d, indent=0)[source]

Returns a vertically formatted string representation of a dictionary.

utils.list_to_str(l, indent=0)[source]

Returns a vertically formatted string representation of a list.

utils.cpu_and_system_props()[source]

Returns a dictionary with properties of CPU and OS.

utils.gpu_props()[source]

Returns a dictionary with properties of GPU device.

utils.hash_function(s)[source]

Returns a hash code (integer) for given string as a base 31 expansion.

utils.hash_str(params, digits)[source]
class utils.Logger(fname)[source]

Bases: object

Class for simultaneous logging to console and a log file (for purposes of experiments).

__init__(fname)[source]

Constructor of MCTSNC instances.

write(message)[source]

Writes a message to console and a log file.

flush()[source]

Empty function required for buffering.

__module__ = 'utils'
utils.experiment_hash_str(experiment_info, c_props, g_props, all_hs_digits=10, experiment_hs_digits=5, env_hs_digits=3)[source]

Returns a hash string for an experiment, based on its settings and properties.

utils.speedups_plot(dtype)[source]

Generates a log-log plot of speed-ups registered for all approaches on computational environment 2 (see research paper).