def __init__(self, config, resume=None, modification=None, run_id=None):
    '\n        class to parse configuration json file. Handles hyperparameters for training, initializations of modules, checkpoint saving\n        and logging module.\n        :param config: Dict containing configurations, hyperparameters for training. contents of `config.json` file for example.\n        :param resume: String, path to the checkpoint being loaded.\n        :param modification: Dict keychain:value, specifying position values to be replaced from config dict.\n        :param run_id: Unique Identifier for training processes. Used to save checkpoints and training log. Timestamp is being used as default\n        '
    self._config = _update_config(config, modification)
    self.resume = resume
    save_dir = Path(self.config['trainer']['save_dir'])
    exper_name = self.config['name']
    if ('fold' in self.config['data_loader']['args']):
        fold = self.config['data_loader']['args']['fold']
    else:
        fold = 0
    if self.resume:
        if os.path.isdir(self.resume):
            self.root_dir = self.resume
        elif os.path.isfile(self.resume):
            self.root_dir = Path(self.resume).parent
    else:
        if (run_id is None):
            run_id = '{}_fold_{}'.format(datetime.now().strftime('%m%d_%H%M%S'), fold)
        self.root_dir = ((save_dir / exper_name) / run_id)
    exist_ok = self.resume
    self.root_dir.mkdir(parents=True, exist_ok=exist_ok)
    write_json(self.config, (self.save_dir / 'config_{}_fold_{}.json'.format(exper_name, fold)))
    setup_logging(self.log_dir)
    self.log_levels = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
class to parse configuration json file. Handles hyperparameters for training, initializations of modules, checkpoint saving
and logging module.
:param config: Dict containing configurations, hyperparameters for training. contents of `config.json` file for example.
:param resume: String, path to the checkpoint being loaded.
:param modification: Dict keychain:value, specifying position values to be replaced from config dict.
:param run_id: Unique Identifier for training processes. Used to save checkpoints and training log. Timestamp is being used as default
def __init__(self, config, resume=None, modification=None, run_id=None):
    '\n        class to parse configuration json file. Handles hyperparameters for training, initializations of modules, checkpoint saving\n        and logging module.\n        :param config: Dict containing configurations, hyperparameters for training. contents of `config.json` file for example.\n        :param resume: String, path to the checkpoint being loaded.\n        :param modification: Dict keychain:value, specifying position values to be replaced from config dict.\n        :param run_id: Unique Identifier for training processes. Used to save checkpoints and training log. Timestamp is being used as default\n        '
    self._config = _update_config(config, modification)
    self.resume = resume
    save_dir = Path(self.config['trainer']['save_dir'])
    exper_name = self.config['name']
    if ('fold' in self.config['data_loader']['args']):
        fold = self.config['data_loader']['args']['fold']
    else:
        fold = 0
    if self.resume:
        if os.path.isdir(self.resume):
            self.root_dir = self.resume
        elif os.path.isfile(self.resume):
            self.root_dir = Path(self.resume).parent
    else:
        if (run_id is None):
            run_id = '{}_fold_{}'.format(datetime.now().strftime('%m%d_%H%M%S'), fold)
        self.root_dir = ((save_dir / exper_name) / run_id)
    exist_ok = self.resume
    self.root_dir.mkdir(parents=True, exist_ok=exist_ok)
    write_json(self.config, (self.save_dir / 'config_{}_fold_{}.json'.format(exper_name, fold)))
    setup_logging(self.log_dir)
    self.log_levels = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}