Ejemplo n.º 1
0
    import tensorflow as tf
    config = tf.ConfigProto(log_device_placement=True)

    from ecalvegan import generator
    from ecalvegan import discriminator

    g_weights = 'params_generator_epoch_'
    d_weights = 'params_discriminator_epoch_'

    nb_epochs = 50
    batch_size = 128
    latent_size = 200
    verbose = 'false'
    poly = [-0.03140347, 1.952197, 0.0827042]
    print(poly)
    generator = generator(latent_size)
    discriminator = discriminator()

    nb_classes = 2

    print('[INFO] Building discriminator')
    discriminator.summary()
    #discriminator.load_weights('veganweights/params_discriminator_epoch_019.hdf5')
    discriminator.compile(
        #optimizer=Adam(lr=adam_lr, beta_1=adam_beta_1),
        optimizer=RMSprop(),
        loss=[
            'binary_crossentropy', 'mean_absolute_percentage_error',
            'mean_absolute_percentage_error'
        ],
        loss_weights=[10, 0.3, 0.1]
Ejemplo n.º 2
0
from array import array
import time

from ecalvegan import generator, discriminator

#gStyle.SetOptStat(0)
gStyle.SetOptFit(1111)  # superimpose fit results
c = TCanvas("c", "Ecal/Ep versus Ep for Data and Generated Events", 200, 10,
            700, 500)  #make nice
c.SetGrid()
gStyle.SetOptStat(0)
#c.SetLogx ()
Eprof = TProfile("Eprof", "Ratio of Ecal and Ep;Ep;Ecal/Ep", 100, 0, 500)
num_events = 1000
latent = 200
g = generator(latent)
#gweight = 'gen_rootfit_2p1p1_ep33.hdf5'
gweight1 = 'params_generator_epoch_041.hdf5'  # 1 gpu
gweight2 = 'params_generator_epoch_023.hdf5'  # 2 gpu
gweight3 = 'params_generator_epoch_011.hdf5'  # 4 gpu
gweight4 = 'params_generator_epoch_005.hdf5'  # 8 gpu
gweight5 = '16gpu_gen.hdf5'  #'params_generator_epoch_002.hdf5'# 16 gpu
g.load_weights(gweight1)
gweights = [gweight1, gweight2, gweight3, gweight4, gweight5]
label = ['1 gpu', '2 gpu', '4 gpu', '8 gpu', '16 gpu']
scales = [100, 1, 1, 1, 1]
color = [4, 2, 3, 6, 7, 8]
filename = 'ecal_ratio_multi.pdf'
#Get Actual Data
#d=h5py.File("/eos/project/d/dshep/LCD/V1/EleEscan/EleEscan_1_1.h5")
d = h5py.File("/afs/cern.ch/work/g/gkhattak/public/Ele_v1_1_2.h5", 'r')