Functions | Variables
run_cnn_1class Namespace Reference

Functions

def load_model (name)
 

Variables

 parser = argparse.ArgumentParser(description='Run CNN over a full 2D projection.')
 
 help
 
 default
 
 args = parser.parse_args()
 
 PATCH_SIZE_W = int(args.rows)
 
 PATCH_SIZE_D = int(args.cols)
 
bool crop_event = False
 
 rootModule = args.module
 
 rootFile = TFile(args.input)
 
list keys = [rootModule+'/'+k.GetName()[:-4] for k in rootFile.Get(rootModule).GetListOfKeys() if '_raw' in k.GetName()]
 
 evname = keys[int(args.event)]
 
 raw
 
 deposit
 
 pdg
 
 tracks
 
 showers
 
 full2d = int(args.full)
 
 total_patches
 
 inputs = np.zeros((total_patches, PATCH_SIZE_W, PATCH_SIZE_D), dtype=np.float32)
 
int cnt_ind = 0
 
 model_name = args.net
 
 m = load_model(model_name)
 
 loss
 
 optimizer
 
 pred = m.predict(inputs.reshape(inputs.shape[0], 1, PATCH_SIZE_W, PATCH_SIZE_D))
 
 outputs = np.zeros((raw.shape[0], raw.shape[1]), dtype=np.float32)
 
 fig
 
 ax
 
 figsize
 
 cs = ax[0,0].pcolor(np.transpose(pdg & 0xFF), cmap='gist_ncar')
 

Function Documentation

def run_cnn_1class.load_model (   name)

Definition at line 38 of file run_cnn_1class.py.

38 def load_model(name):
39  with open(name + '_architecture.json') as f:
40  model = model_from_json(f.read())
41  model.load_weights(name + '_weights.h5')
42  return model
43 
44 
int open(const char *, int)
Opens a file descriptor.
def load_model(name)

Variable Documentation

run_cnn_1class.args = parser.parse_args()

Definition at line 11 of file run_cnn_1class.py.

run_cnn_1class.ax

Definition at line 98 of file run_cnn_1class.py.

int run_cnn_1class.cnt_ind = 0

Definition at line 62 of file run_cnn_1class.py.

bool run_cnn_1class.crop_event = False

Definition at line 47 of file run_cnn_1class.py.

run_cnn_1class.cs = ax[0,0].pcolor(np.transpose(pdg & 0xFF), cmap='gist_ncar')

Definition at line 100 of file run_cnn_1class.py.

run_cnn_1class.default

Definition at line 3 of file run_cnn_1class.py.

run_cnn_1class.deposit

Definition at line 54 of file run_cnn_1class.py.

run_cnn_1class.evname = keys[int(args.event)]

Definition at line 52 of file run_cnn_1class.py.

run_cnn_1class.fig

Definition at line 98 of file run_cnn_1class.py.

run_cnn_1class.figsize

Definition at line 98 of file run_cnn_1class.py.

run_cnn_1class.full2d = int(args.full)

Definition at line 55 of file run_cnn_1class.py.

run_cnn_1class.help

Definition at line 3 of file run_cnn_1class.py.

run_cnn_1class.inputs = np.zeros((total_patches, PATCH_SIZE_W, PATCH_SIZE_D), dtype=np.float32)

Definition at line 60 of file run_cnn_1class.py.

list run_cnn_1class.keys = [rootModule+'/'+k.GetName()[:-4] for k in rootFile.Get(rootModule).GetListOfKeys() if '_raw' in k.GetName()]

Definition at line 51 of file run_cnn_1class.py.

run_cnn_1class.loss

Definition at line 76 of file run_cnn_1class.py.

run_cnn_1class.m = load_model(model_name)

Definition at line 75 of file run_cnn_1class.py.

run_cnn_1class.model_name = args.net

Definition at line 74 of file run_cnn_1class.py.

run_cnn_1class.optimizer

Definition at line 76 of file run_cnn_1class.py.

run_cnn_1class.outputs = np.zeros((raw.shape[0], raw.shape[1]), dtype=np.float32)

Definition at line 84 of file run_cnn_1class.py.

run_cnn_1class.parser = argparse.ArgumentParser(description='Run CNN over a full 2D projection.')

Definition at line 2 of file run_cnn_1class.py.

run_cnn_1class.PATCH_SIZE_D = int(args.cols)

Definition at line 46 of file run_cnn_1class.py.

run_cnn_1class.PATCH_SIZE_W = int(args.rows)

Definition at line 45 of file run_cnn_1class.py.

run_cnn_1class.pdg

Definition at line 54 of file run_cnn_1class.py.

run_cnn_1class.pred = m.predict(inputs.reshape(inputs.shape[0], 1, PATCH_SIZE_W, PATCH_SIZE_D))

Definition at line 79 of file run_cnn_1class.py.

run_cnn_1class.raw

Definition at line 54 of file run_cnn_1class.py.

run_cnn_1class.rootFile = TFile(args.input)

Definition at line 50 of file run_cnn_1class.py.

run_cnn_1class.rootModule = args.module

Definition at line 49 of file run_cnn_1class.py.

run_cnn_1class.showers

Definition at line 54 of file run_cnn_1class.py.

run_cnn_1class.total_patches

Definition at line 56 of file run_cnn_1class.py.

run_cnn_1class.tracks

Definition at line 54 of file run_cnn_1class.py.