train_tools.utils

Module Contents

class train_tools.utils.ConfLoader(conf_name)[source]

Load json config file using DictWithAttributeAccess object_hook. ConfLoader(conf_name).opt attribute is the result of loading json config file.

class DictWithAttributeAccess[source]

Bases: dict

This inner class makes dict to be accessed same as class attribute. For example, you can use opt.key instead of the opt[‘key’].

conf_name[source]
opt[source]
train_tools.utils.directory_setter(path='./results', make_dir=False)[source]

Make dictionary if not exists.

train_tools.utils.random_seeder(seed)[source]

Fix randomness.

train_tools.utils.pprint_config(opt)[source]