def main(): # capture the config path from the run arguments # then process the json configuration file try: args = get_args() config = process_config(args.config) except: print("missing or invalid arguments") exit(0) # create the experiments dirs create_dirs([config.summary_dir, config.checkpoint_dir]) print('Create the data generator.') data_generator = DataGenerator(config) print('Create the model.') model = MultiLabelConvModel(config, data_generator.get_word_index()) print('Create the trainer') trainer = MultiLabelConvModelTrainer(model.model, data_generator.get_train_data(), config) print('Start training the model.') trainer.train() print('Visualize the losses') trainer.visualize()
def main(): try: args = get_args() config = process_config(args.config) except: print("missing or invalid arguments") exit(0) # create the experiments dirs create_dirs(([config.summary_dir, config.checkpoint_dir])) print("Create the data generator") data_generator = DataGenerator(config) print("Create the model.") model = CNNModel(config, data_generator.get_word_index()) print("Trainer initiatise") trainer = ModelTrainer(model.model, data_generator.get_train_data(), config) print("Training Start") trainer.train() print("Visualization of loss and accuracy") trainer.visualize("FastText +CNN")