Namespaces | Functions | Variables
generate_datataset.py File Reference

Go to the source code of this file.

Namespaces

 generate_datataset
 

Functions

def generate_datataset.normalize (value)
 
def generate_datataset.normalize2 (value)
 

Variables

string generate_datataset.__version__ = '1.0'
 
string generate_datataset.__author__ = 'Saul Alonso-Monsalve'
 
string generate_datataset.__email__ = "saul.alonso.monsalve@cern.ch"
 
 generate_datataset.stream
 
 generate_datataset.stdout
 
 generate_datataset.level
 
 generate_datataset.config = configparser.ConfigParser()
 
 generate_datataset.SEED = int(config['random']['seed'])
 
 generate_datataset.IMAGES_PATH = config['images']['path']
 
 generate_datataset.VIEWS = int(config['images']['views'])
 
 generate_datataset.PLANES = int(config['images']['planes'])
 
 generate_datataset.CELLS = int(config['images']['cells'])
 
 generate_datataset.DATASET_PATH = config['dataset']['path']
 
 generate_datataset.PARTITION_PREFIX = config['dataset']['partition_prefix']
 
 generate_datataset.LABELS_PREFIX = config['dataset']['labels_prefix']
 
 generate_datataset.UNIFORM = ast.literal_eval(config['dataset']['uniform'])
 
 generate_datataset.OUTPUTS = int(config['model']['outputs'])
 
 generate_datataset.TRAIN_FRACTION = float(config['train']['fraction'])
 
 generate_datataset.WEIGHTED_LOSS_FUNCTION = ast.literal_eval(config['train']['weighted_loss_function'])
 
 generate_datataset.CLASS_WEIGHTS_PREFIX = config['train']['class_weights_prefix']
 
 generate_datataset.VALIDATION_FRACTION = float(config['validation']['fraction'])
 
 generate_datataset.TEST_FRACTION = float(config['test']['fraction'])
 
int generate_datataset.count_flavour = [0]*4
 
int generate_datataset.count_category = [0]*14
 
dictionary generate_datataset.partition = {'train' : [], 'validation' : [], 'test' : []}
 
dictionary generate_datataset.labels = {}
 
list generate_datataset.y_train = []
 
list generate_datataset.y1_class_weights = []
 
list generate_datataset.y2_class_weights = []
 
list generate_datataset.only_train = ['nutau2', 'nutau3']
 
int generate_datataset.count_neutrinos = 0
 
int generate_datataset.count_antineutrinos = 0
 
int generate_datataset.count_empty_views = 0
 
int generate_datataset.count_empty_events = 0
 
int generate_datataset.count_less_10nonzero_views = 0
 
int generate_datataset.count_less_10nonzero_events = 0
 
 generate_datataset.count_train
 
 generate_datataset.count_val
 
 generate_datataset.count_test
 
 generate_datataset.files = list(glob.iglob(images_path + "/images/*"))
 
 generate_datataset.ID = imagefile.split("/")[-1][:-3]
 
string generate_datataset.infofile = images_path+'/info/'
 
 generate_datataset.info = open(infofile, 'r').readlines()
 
 generate_datataset.fInt = int(info[0].strip())
 
int generate_datataset.flavour = fInt//4
 
int generate_datataset.interaction = fInt%4
 
 generate_datataset.fNuEnergy = float(info[1].strip())
 
 generate_datataset.fLepEnergy = float(info[2].strip())
 
 generate_datataset.fRecoNueEnergy = float(info[3].strip())
 
 generate_datataset.fRecoNumuEnergy = float(info[4].strip())
 
 generate_datataset.fEventWeight = float(info[5].strip())
 
 generate_datataset.fNuPDG = normalize2(int(info[6].strip()))
 
 generate_datataset.fNProton = normalize(int(info[7].strip()))
 
 generate_datataset.fNPion = normalize(int(info[8].strip()))
 
 generate_datataset.fNPizero = normalize(int(info[9].strip()))
 
 generate_datataset.fNNeutron = normalize(int(info[10].strip()))
 
 generate_datataset.random_value = np.random.uniform(0,1)
 
 generate_datataset.pixels = np.fromstring(zlib.decompress(image_file.read()), dtype=np.uint8, sep='').reshape(VIEWS, PLANES, CELLS)
 
list generate_datataset.views = [None]*VIEWS
 
list generate_datataset.empty_view = [0,0,0]
 
list generate_datataset.non_empty_view = [0,0,0]
 
int generate_datataset.count_empty = 0
 
int generate_datataset.count_less_10nonzero = 0
 
 generate_datataset.maxi = np.max(views[i])
 
 generate_datataset.mini = np.min(views[i])
 
 generate_datataset.nonzero = np.count_nonzero(views[i])
 
 generate_datataset.total = np.sum(views[i])
 
 generate_datataset.avg = np.mean(views[i])