def db_from_df(train, test, bs=1024):
    # Create TensorDatasets
    train_ds = TensorDataset(torch.tensor(train.values),
                             torch.tensor(train.values))
    valid_ds = TensorDataset(torch.tensor(test.values),
                             torch.tensor(test.values))
    # Create DataLoaders
    train_dl, valid_dl = get_data(train_ds, valid_ds, bs=bs)
    # Return DataBunch
    return basic_data.DataBunch(train_dl, valid_dl)
test = test[test['m'] > 1e-3]

if input_dim == 25:
    train.pop('Width')
    train.pop('WidthPhi')
    test.pop('Width')
    test.pop('WidthPhi')

bs = 1024
# Create TensorDatasets
train_ds = TensorDataset(torch.tensor(train.values, dtype=torch.float),
                         torch.tensor(train.values, dtype=torch.float))
valid_ds = TensorDataset(torch.tensor(test.values, dtype=torch.float),
                         torch.tensor(test.values, dtype=torch.float))
# Create DataLoaders
train_dl, valid_dl = get_data(train_ds, valid_ds, bs=bs)
# Return DataBunch
db = basic_data.DataBunch(train_dl, valid_dl)

module_name = 'AE_bn_LeakyReLU'
module = AE_bn_LeakyReLU

grid_search_folder = module_name + '_AOD_grid_search_custom_normalization_1500epochs/'
model_folder = 'AE_%d_200_200_200_%d_200_200_200_%d' % (input_dim, latent_dim,
                                                        input_dim)
train_folder = 'AE_bn_LeakyReLU_bs4096_lr1e-02_wd1e-02_ppNA'
save = False

loss_func = nn.MSELoss()

plt.close('all')