Exemplo n.º 1
0
def main():

    input_folder = Path('data/input/')
    train_file = Path('train.csv')
    test_file = Path('test.csv')

    logging.info('> Loading data')
    train = pd.read_csv(input_folder/train_file, index_col=0)
    test = pd.read_csv(input_folder/test_file, index_col=0)
    
    train = reduce_mem_usage(train)
    test = reduce_mem_usage(test)
    
    train = prepare_dataset(train)
    test = prepare_dataset(test)
    
    logging.info('> Exporting train dataset')
    train.to_csv(input_folder/train_file)
    logging.info('> Exporting test dataset')
    test.to_csv(input_folder/test_file)
Exemplo n.º 2
0
        if args.check_dataset:
            from generate_simulation_data import GenerateSimulationData as sim
            print('\nChecking conformity of %s %s dataset…' % (d, c))
            sim.check_dataset_conformity(run_dir,
                                         run_img_dir,
                                         'Dataset - %s avg_gap-%s %s' %
                                         (args.net_input, args.avg_gap, c),
                                         c,
                                         net_input=args.net_input,
                                         communication=communication)

        if args.train_net or args.plots_net:
            from utils.utils import prepare_dataset

            indices = prepare_dataset(run_dir, args.generate_split,
                                      args.n_simulations)
            file_losses = os.path.join(model_dir, 'losses.npy')

            if args.train_net:
                from network_training_distribute import network_train
                network_train(indices,
                              file_losses,
                              runs_dir_omniscient,
                              model_dir,
                              args.model,
                              communication,
                              net_input=args.net_input,
                              save_net=args.save_net)

            if args.plots_net:
                from network_evaluation import network_evaluation
Exemplo n.º 3
0
 def reconst_loss(self, inputs):
     '''  ------------------------------------------------------------------------------
                                      DATA PROCESSING
     ------------------------------------------------------------------------------ '''
     inputs = utils.prepare_dataset(inputs)
     return self.model.reconst_loss(inputs)
Exemplo n.º 4
0
 def interpolate(self, input1, input2):
     input1 = utils.prepare_dataset(input1)
     input2 = utils.prepare_dataset(input2)
     return self.model.interpolate(input1, input2)
Exemplo n.º 5
0
 def encode(self, inputs):
     '''  ------------------------------------------------------------------------------
                                      DATA PROCESSING
     ------------------------------------------------------------------------------ '''
     inputs = utils.prepare_dataset(inputs)
     return self.model.encode(inputs)