data_type = data_type + "_" + sample_type samples_dir = conf['data_path'].split('/')[5] dim = (int(samples_dir.split('_')[-2]), int(samples_dir.split('_')[-1])) if sample_type == "raw_samples": if net_type == "NOREC": print('Puting the test data into the right shape...') parameters, testX, testY = frame_utils.read_frame_data( conf['data_path'], sample_type) to_test_net = Net.Convolution2D(model_file=conf['model_path'], framework="keras") else: print('Puting the test data into the right shape...') parameters, testX, testY = frame_utils.read_frame_data( conf['data_path'], sample_type, True) to_test_net = Net.ConvolutionLstm( model_file=conf['model_path'], framework="keras") else: parameters, testX, testY = frame_utils.read_frame_data( conf['data_path'], sample_type) if net_type == "NOREC": print('Puting the test data into the right shape...') to_test_net = Net.Mlp(model_file=conf['model_path'], framework="tensorflow") else: print('Puting the test data into the right shape...') to_test_net = Net.Lstm(model_file=conf['model_path'], framework="tensorflow") gap = parameters.iloc[0]['gap'] to_test_net.test(testX, testY, gap, data_type, dim)
_, trainX, trainY = frame_utils.read_frame_data(data_dir + 'train/', 'raw_samples', channels) _, valX, valY = frame_utils.read_frame_data(data_dir + 'val/', 'raw_samples', channels) train_data = [trainX, trainY] val_data = [valX, valY] in_dim = trainX.shape[1:] out_dim = np.prod(in_dim[1:]) # Model settings if net_type == "NoRec": to_train_net = Net.Convolution2D(activation=activation, loss=loss, dropout=dropout, drop_percentage=drop_percentage, input_shape=in_dim, output_shape=out_dim, complexity=complexity, framework="keras") else: to_train_net = Net.ConvolutionLstm(activation=activation, loss=loss, dropout=dropout, drop_percentage=drop_percentage, input_shape=in_dim, output_shape=out_dim, complexity=complexity, framework="keras") else: print("Modeled images") loss = conf['modeled_frame_loss'] activation = conf['modeled_activation'] dim = (int(samples_dir.split('_')[-2]), int(samples_dir.split('_')[-1])) filename = root + "_Modeled/" + complexity _, trainX, trainY = frame_utils.read_frame_data(data_dir + 'train/', 'modeled_samples') _, valX, valY = frame_utils.read_frame_data(data_dir + 'val/', 'modeled_samples') train_data = [trainX, trainY] val_data = [valX, valY] # Model settings