Exemplo n.º 1
0
 def __init__(self, infer_config):
     self.infer_config = infer_config
     setup_logging(infer_config)
     self.logger = setup_logger(self, infer_config["verbose"])
     self.run_inference = infer_config.get("run_inference", False)
     train_cfg = infer_config["training"]
     self.randomiser = globals()[train_cfg["randomiser"]](train_cfg["template"])
    def __init__(self, model, loss, metrics, optimizer, start_epoch, config, device):
        self.logger = setup_logger(self, verbose=config["training"]["verbose"])
        self.model = model
        self.loss = loss
        self.metrics = metrics
        self.optimizer = optimizer
        self.start_epoch = start_epoch
        self.config = config
        self.device = device

        self._setup_monitoring(config["training"])

        self.checkpoint_dir, writer_dir = get_trainer_paths(config)
        self.writer = TensorboardWriter(writer_dir, config["training"]["tensorboard"])

        # Save configuration file into checkpoint directory:
        config_save_path = Path(self.checkpoint_dir) / "config.yml"
        with open(config_save_path, "w") as handle:
            yaml.dump(config, handle, default_flow_style=False)
 def __init__(self, verbose=0):
     super().__init__()
     self.logger = setup_logger(self, verbose=verbose)
 def __init__(self, data_dir, nworkers=4, verbose=2):
     self.data_dir = Path(data_dir)
     self.nworkers = nworkers
     self.logger = setup_logger(self, verbose)
     self.data_dir.mkdir(parents=True, exist_ok=True)
Exemplo n.º 5
0
 def __init__(self, verbose=0):
     self.logger = setup_logger(self, verbose)
 def __init__(self, config: dict):
     setup_logging(config)
     seed_everything(config["seed"])
     self.logger = setup_logger(self, config["verbose"])
     self.cfg = config
Exemplo n.º 7
0
 def __init__(self, n_imgs, verbose=2):
     self.N = n_imgs
     self.logger = setup_logger(self, verbose)