<jupyter_start><jupyter_text>Out Sample Test DataNew 2D format, all out of sample  1000 big batch<jupyter_code>estimator = MorphingAwareRatioEstimator(
    morphing_setup_filename=os.getcwd()+'/data/setup.h5',
    n_hidden=(60,60),
    activation="tanh",
)

estimator.load(os.getcwd()+'/models/carl1000-bigbatch')
gphival = 50
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 40
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 30
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 20
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 10
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 5
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()<jupyter_output>NSM = 2225.504 --- NBSM = 2273.448
test 0   : tsm = 221.184,  tbsm = 164.740
Reaching the end of test data. Stop tests at 219. 
===> delta1 = 0.022, delta2 = 0.015
p = 0.119 +/- 0.026
Separation = 1.17 sigmas
Partial test after 1 epochs (took 39.52 seconds)<jupyter_text>50 epochs with big batch<jupyter_code>estimator = MorphingAwareRatioEstimator(
    morphing_setup_filename=os.getcwd()+'/data/setup.h5',
    n_hidden=(60,60),
    activation="tanh",
)

estimator.load(os.getcwd()+'/models/carl50-bigbatch')
gphival = 50
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 40
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 30
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 20
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 10
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 5
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()<jupyter_output>NSM = 2225.504 --- NBSM = 2273.448
test 0   : tsm = 649.943,  tbsm = 589.049
Reaching the end of test data. Stop tests at 220. 
===> delta1 = 0.030, delta2 = 0.025
p = 0.273 +/- 0.039
Separation = 0.61 sigmas
Partial test after 1 epochs (took 39.92 seconds)<jupyter_text>10 big batch<jupyter_code>estimator = MorphingAwareRatioEstimator(
    morphing_setup_filename=os.getcwd()+'/data/setup.h5',
    n_hidden=(60,60),
    activation="tanh",
)

estimator.load(os.getcwd()+'/models/carl10-bigbatch')
gphival = 50
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 40
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 30
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 20
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 10
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 5
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()<jupyter_output>NSM = 2225.504 --- NBSM = 2273.448
test 0   : tsm = 59.320,  tbsm = 73.057
Reaching the end of test data. Stop tests at 220. 
===> delta1 = 0.026, delta2 = 0.023
p = 0.182 +/- 0.035
Separation = 0.81 sigmas
Partial test after 1 epochs (took 39.95 seconds)<jupyter_text>1000 default batch<jupyter_code>estimator = MorphingAwareRatioEstimator(
    morphing_setup_filename=os.getcwd()+'/data/setup.h5',
    n_hidden=(60,60),
    activation="tanh",
)

estimator.load(os.getcwd()+'/models/carl')
gphival = 50
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 40
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 30
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 20
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 10
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()
gphival = 5
f = h5py.File(os.getcwd()+'/toydata/gphi_toydata_test_%d_out.h5'%(gphival), 'r')
Data = np.array(f['Data'])
Labels = np.array(f['Labels'])
NSM = np.array(f['NSM'])
NBSMList = np.array(f['NBSMList'])
NBSM = NBSMList[0]

n_epochs = int(1e4)
results_path = os.getcwd()

Idx_test = torch.randperm(len(Data))
Data_test = torch.Tensor(Data[Idx_test])
Label_test = torch.Tensor(Labels[Idx_test])


test_model(estimator, Data_test[Label_test==0, :], Data_test[Label_test==1, :], 1, 1, 4000, 'plus', 
          verbose_t=True, verbose_period_t=1e5, title='gphi%d_new'%(gphival))

f.close()<jupyter_output>NSM = 2225.504 --- NBSM = 2273.448
test 0   : tsm = 230.866,  tbsm = 149.098
Reaching the end of test data. Stop tests at 219. 
===> delta1 = 0.031, delta2 = 0.027
p = 0.315 +/- 0.042
Separation = 0.46 sigmas
Partial test after 1 epochs (took 39.24 seconds)
{'fraction_non_alphanumeric': 0.19155170308875596, 'fraction_numerical': 0.04071541936271517, 'mean_word_length': 6.010269576379974, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '194865', 'license': 'MIT', 'n_tokens_mistral': 7773, 'n_tokens_neox': 7255, 'n_words': 1053, 'path': 'examples/tutorial_particle_physics/TestEstimator-Results.ipynb', 'repo_name': 'siyuchen95/madminer', 'size': '16382'}