Functions | |
def | save_model (model, name) |
Variables | |
parser = argparse.ArgumentParser(description='Run CNN training on patches with a few different hyperparameter sets.') | |
help | |
default | |
args = parser.parse_args() | |
config = read_config(args.config) | |
configuration ############################# More... | |
CNN_INPUT_DIR = config['training_on_patches']['input_dir'] | |
PATCH_SIZE_W | |
PATCH_SIZE_D | |
img_rows | |
img_cols | |
batch_size = config['training_on_patches']['batch_size'] | |
nb_classes = config['training_on_patches']['nb_classes'] | |
nb_epoch = config['training_on_patches']['nb_epoch'] | |
int | nb_pool = 2 |
string | cfg_name = 'sgd_lorate' |
int | nb_filters1 = 48 |
int | nb_conv1 = 5 |
string | convactfn1 = 'relu' |
bool | maxpool = False |
int | nb_filters2 = 0 |
int | nb_conv2 = 7 |
string | convactfn2 = 'relu' |
float | drop1 = 0.2 |
int | densesize1 = 128 |
string | actfn1 = 'relu' |
int | densesize2 = 32 |
string | actfn2 = 'relu' |
float | drop2 = 0.2 |
main_input = Input(shape=(img_rows, img_cols, 1), name='main_input') | |
CNN definition ############################. More... | |
x | |
em_trk_none = Dense(3, activation='softmax', name='em_trk_none_netout')(x) | |
michel = Dense(1, activation='sigmoid', name='michel_netout')(x) | |
sgd = SGD(lr=0.01, decay=1e-5, momentum=0.9, nesterov=True) | |
model = Model(inputs=[main_input], outputs=[em_trk_none, michel]) | |
optimizer | |
loss | |
loss_weights | |
n_training = count_events(CNN_INPUT_DIR, 'training') | |
read data sets ############################ More... | |
X_train = np.zeros((n_training, PATCH_SIZE_W, PATCH_SIZE_D, 1), dtype=np.float32) | |
EmTrkNone_train = np.zeros((n_training, 3), dtype=np.int32) | |
Michel_train = np.zeros((n_training, 1), dtype=np.int32) | |
int | ntot = 0 |
list | subdirs = [f for f in os.listdir(CNN_INPUT_DIR) if 'training' in f] |
list | filesX = [f for f in os.listdir(CNN_INPUT_DIR + '/' + dirname) if '_x.npy' in f] |
fnameY = fnameX.replace('_x.npy', '_y.npy') | |
dataX = np.load(CNN_INPUT_DIR + '/' + dirname + '/' + fnameX) | |
dataY = np.load(CNN_INPUT_DIR + '/' + dirname + '/' + fnameY) | |
n = dataY.shape[0] | |
n_testing = count_events(CNN_INPUT_DIR, 'testing') | |
X_test = np.zeros((n_testing, PATCH_SIZE_W, PATCH_SIZE_D, 1), dtype=np.float32) | |
EmTrkNone_test = np.zeros((n_testing, 3), dtype=np.int32) | |
Michel_test = np.zeros((n_testing, 1), dtype=np.int32) | |
h | |
training ############################### More... | |
score | |
def train_cnn.save_model | ( | model, | |
name | |||
) |
Definition at line 35 of file train_cnn.py.
string train_cnn.actfn1 = 'relu' |
Definition at line 76 of file train_cnn.py.
string train_cnn.actfn2 = 'relu' |
Definition at line 78 of file train_cnn.py.
train_cnn.args = parser.parse_args() |
Definition at line 6 of file train_cnn.py.
train_cnn.batch_size = config['training_on_patches']['batch_size'] |
Definition at line 53 of file train_cnn.py.
string train_cnn.cfg_name = 'sgd_lorate' |
Definition at line 59 of file train_cnn.py.
train_cnn.CNN_INPUT_DIR = config['training_on_patches']['input_dir'] |
Definition at line 48 of file train_cnn.py.
train_cnn.config = read_config(args.config) |
configuration #############################
Definition at line 46 of file train_cnn.py.
string train_cnn.convactfn1 = 'relu' |
Definition at line 64 of file train_cnn.py.
string train_cnn.convactfn2 = 'relu' |
Definition at line 70 of file train_cnn.py.
train_cnn.dataX = np.load(CNN_INPUT_DIR + '/' + dirname + '/' + fnameX) |
Definition at line 142 of file train_cnn.py.
train_cnn.dataY = np.load(CNN_INPUT_DIR + '/' + dirname + '/' + fnameY) |
Definition at line 145 of file train_cnn.py.
train_cnn.default |
Definition at line 3 of file train_cnn.py.
int train_cnn.densesize1 = 128 |
Definition at line 75 of file train_cnn.py.
int train_cnn.densesize2 = 32 |
Definition at line 77 of file train_cnn.py.
float train_cnn.drop1 = 0.2 |
Definition at line 72 of file train_cnn.py.
float train_cnn.drop2 = 0.2 |
Definition at line 79 of file train_cnn.py.
Definition at line 117 of file train_cnn.py.
train_cnn.EmTrkNone_test = np.zeros((n_testing, 3), dtype=np.int32) |
Definition at line 155 of file train_cnn.py.
train_cnn.EmTrkNone_train = np.zeros((n_training, 3), dtype=np.int32) |
Definition at line 129 of file train_cnn.py.
list train_cnn.filesX = [f for f in os.listdir(CNN_INPUT_DIR + '/' + dirname) if '_x.npy' in f] |
Definition at line 138 of file train_cnn.py.
train_cnn.fnameY = fnameX.replace('_x.npy', '_y.npy') |
Definition at line 141 of file train_cnn.py.
train_cnn.h |
training ###############################
Definition at line 186 of file train_cnn.py.
train_cnn.help |
Definition at line 3 of file train_cnn.py.
train_cnn.img_cols |
Definition at line 51 of file train_cnn.py.
train_cnn.img_rows |
Definition at line 51 of file train_cnn.py.
train_cnn.loss |
Definition at line 123 of file train_cnn.py.
train_cnn.loss_weights |
Definition at line 124 of file train_cnn.py.
CNN definition ############################.
Definition at line 84 of file train_cnn.py.
bool train_cnn.maxpool = False |
Definition at line 66 of file train_cnn.py.
Definition at line 118 of file train_cnn.py.
train_cnn.Michel_test = np.zeros((n_testing, 1), dtype=np.int32) |
Definition at line 156 of file train_cnn.py.
train_cnn.Michel_train = np.zeros((n_training, 1), dtype=np.int32) |
Definition at line 130 of file train_cnn.py.
train_cnn.model = Model(inputs=[main_input], outputs=[em_trk_none, michel]) |
Definition at line 121 of file train_cnn.py.
train_cnn.n = dataY.shape[0] |
Definition at line 146 of file train_cnn.py.
train_cnn.n_testing = count_events(CNN_INPUT_DIR, 'testing') |
Definition at line 153 of file train_cnn.py.
train_cnn.n_training = count_events(CNN_INPUT_DIR, 'training') |
read data sets ############################
Definition at line 127 of file train_cnn.py.
train_cnn.nb_classes = config['training_on_patches']['nb_classes'] |
Definition at line 54 of file train_cnn.py.
int train_cnn.nb_conv1 = 5 |
Definition at line 63 of file train_cnn.py.
int train_cnn.nb_conv2 = 7 |
Definition at line 69 of file train_cnn.py.
train_cnn.nb_epoch = config['training_on_patches']['nb_epoch'] |
Definition at line 55 of file train_cnn.py.
int train_cnn.nb_filters1 = 48 |
Definition at line 62 of file train_cnn.py.
int train_cnn.nb_filters2 = 0 |
Definition at line 68 of file train_cnn.py.
int train_cnn.nb_pool = 2 |
Definition at line 57 of file train_cnn.py.
int train_cnn.ntot = 0 |
Definition at line 133 of file train_cnn.py.
train_cnn.optimizer |
Definition at line 122 of file train_cnn.py.
train_cnn.parser = argparse.ArgumentParser(description='Run CNN training on patches with a few different hyperparameter sets.') |
Definition at line 2 of file train_cnn.py.
train_cnn.PATCH_SIZE_D |
Definition at line 50 of file train_cnn.py.
train_cnn.PATCH_SIZE_W |
Definition at line 50 of file train_cnn.py.
train_cnn.score |
Definition at line 198 of file train_cnn.py.
train_cnn.sgd = SGD(lr=0.01, decay=1e-5, momentum=0.9, nesterov=True) |
Definition at line 120 of file train_cnn.py.
list train_cnn.subdirs = [f for f in os.listdir(CNN_INPUT_DIR) if 'training' in f] |
Definition at line 134 of file train_cnn.py.
train_cnn.x |
Definition at line 87 of file train_cnn.py.
train_cnn.X_test = np.zeros((n_testing, PATCH_SIZE_W, PATCH_SIZE_D, 1), dtype=np.float32) |
Definition at line 154 of file train_cnn.py.
train_cnn.X_train = np.zeros((n_training, PATCH_SIZE_W, PATCH_SIZE_D, 1), dtype=np.float32) |
Definition at line 128 of file train_cnn.py.