Ejemplo n.º 1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    config = load_config(args.config_path)
    run_train_model(config)
Ejemplo n.º 2
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    config = load_config(args.config_path)
    run_grid_search(config)
Ejemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    config = load_config(args.config_path)
    build_inference_data(config)
Ejemplo n.º 4
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    config: ConfigBase = load_config(args.config_path)
    config.model.predict()
Ejemplo n.º 5
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    config: ConfigBase = load_config(args.config_path)
    config.data_builder.build_training_data()
Ejemplo n.º 6
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    logger.info("load config")
    config: ConfigBase = load_config(args.config_path)

    logger.info("start beautify")

    beautifier = config.data_beautifier
    beautifier.beautify()
Ejemplo n.º 7
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("config_path")
    args = parser.parse_args()

    config = load_config(args.config_path)

    train_data_loader = DataLoader(config.train_dataset,
                                   batch_size=config.batch_size,
                                   shuffle=True,
                                   pin_memory=True,
                                   num_workers=config.num_workers)

    val_data_loader = DataLoader(config.val_dataset,
                                 batch_size=config.batch_size,
                                 shuffle=False,
                                 num_workers=config.num_workers)

    model = config.model

    model_save_path = config.model_save_path
    os.makedirs(model_save_path, exist_ok=True)

    logger_path = os.path.join(model_save_path, "log.txt")

    setup_logger(out_file=logger_path)

    trainer = config.trainer_cls(model=model,
                                 train_data_loader=train_data_loader,
                                 val_data_loader=val_data_loader,
                                 epoch_count=config.epoch_count,
                                 optimizer=config.optimizer,
                                 scheduler=config.scheduler,
                                 loss_calculator=config.loss_calculator,
                                 metric_calculator=config.metric_calculator,
                                 print_frequency=config.print_frequency)

    trainer.run()