Functions | |
def | save_model (model, name) |
def | generate_data_generator (generator, X, Y1, Y2, b) |
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) | |
datagen | |
training ############################### More... | |
h | |
score | |
def train_cnn_augmented_data.generate_data_generator | ( | generator, | |
X, | |||
Y1, | |||
Y2, | |||
b | |||
) |
Definition at line 196 of file train_cnn_augmented_data.py.
def train_cnn_augmented_data.save_model | ( | model, | |
name | |||
) |
Definition at line 36 of file train_cnn_augmented_data.py.
string train_cnn_augmented_data.actfn1 = 'relu' |
Definition at line 77 of file train_cnn_augmented_data.py.
string train_cnn_augmented_data.actfn2 = 'relu' |
Definition at line 79 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.args = parser.parse_args() |
Definition at line 6 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.batch_size = config['training_on_patches']['batch_size'] |
Definition at line 54 of file train_cnn_augmented_data.py.
string train_cnn_augmented_data.cfg_name = 'sgd_lorate' |
Definition at line 60 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.CNN_INPUT_DIR = config['training_on_patches']['input_dir'] |
Definition at line 49 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.config = read_config(args.config) |
configuration #############################
Definition at line 47 of file train_cnn_augmented_data.py.
string train_cnn_augmented_data.convactfn1 = 'relu' |
Definition at line 65 of file train_cnn_augmented_data.py.
string train_cnn_augmented_data.convactfn2 = 'relu' |
Definition at line 71 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.datagen |
training ###############################
Definition at line 186 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.dataX = np.load(CNN_INPUT_DIR + '/' + dirname + '/' + fnameX) |
Definition at line 143 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.dataY = np.load(CNN_INPUT_DIR + '/' + dirname + '/' + fnameY) |
Definition at line 146 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.default |
Definition at line 3 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.densesize1 = 128 |
Definition at line 76 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.densesize2 = 32 |
Definition at line 78 of file train_cnn_augmented_data.py.
float train_cnn_augmented_data.drop1 = 0.2 |
Definition at line 73 of file train_cnn_augmented_data.py.
float train_cnn_augmented_data.drop2 = 0.2 |
Definition at line 80 of file train_cnn_augmented_data.py.
Definition at line 118 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.EmTrkNone_test = np.zeros((n_testing, 3), dtype=np.int32) |
Definition at line 156 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.EmTrkNone_train = np.zeros((n_training, 3), dtype=np.int32) |
Definition at line 130 of file train_cnn_augmented_data.py.
list train_cnn_augmented_data.filesX = [f for f in os.listdir(CNN_INPUT_DIR + '/' + dirname) if '_x.npy' in f] |
Definition at line 139 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.fnameY = fnameX.replace('_x.npy', '_y.npy') |
Definition at line 142 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.h |
Definition at line 205 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.help |
Definition at line 3 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.img_cols |
Definition at line 52 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.img_rows |
Definition at line 52 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.loss |
Definition at line 124 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.loss_weights |
Definition at line 125 of file train_cnn_augmented_data.py.
CNN definition ############################.
Definition at line 85 of file train_cnn_augmented_data.py.
bool train_cnn_augmented_data.maxpool = False |
Definition at line 67 of file train_cnn_augmented_data.py.
Definition at line 119 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.Michel_test = np.zeros((n_testing, 1), dtype=np.int32) |
Definition at line 157 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.Michel_train = np.zeros((n_training, 1), dtype=np.int32) |
Definition at line 131 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.model = Model(inputs=[main_input], outputs=[em_trk_none, michel]) |
Definition at line 122 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.n = dataY.shape[0] |
Definition at line 147 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.n_testing = count_events(CNN_INPUT_DIR, 'testing') |
Definition at line 154 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.n_training = count_events(CNN_INPUT_DIR, 'training') |
read data sets ############################
Definition at line 128 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.nb_classes = config['training_on_patches']['nb_classes'] |
Definition at line 55 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.nb_conv1 = 5 |
Definition at line 64 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.nb_conv2 = 7 |
Definition at line 70 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.nb_epoch = config['training_on_patches']['nb_epoch'] |
Definition at line 56 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.nb_filters1 = 48 |
Definition at line 63 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.nb_filters2 = 0 |
Definition at line 69 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.nb_pool = 2 |
Definition at line 58 of file train_cnn_augmented_data.py.
int train_cnn_augmented_data.ntot = 0 |
Definition at line 134 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.optimizer |
Definition at line 123 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.parser = argparse.ArgumentParser(description='Run CNN training on patches with a few different hyperparameter sets.') |
Definition at line 2 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.PATCH_SIZE_D |
Definition at line 51 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.PATCH_SIZE_W |
Definition at line 51 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.score |
Definition at line 217 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.sgd = SGD(lr=0.01, decay=1e-5, momentum=0.9, nesterov=True) |
Definition at line 121 of file train_cnn_augmented_data.py.
list train_cnn_augmented_data.subdirs = [f for f in os.listdir(CNN_INPUT_DIR) if 'training' in f] |
Definition at line 135 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.x |
Definition at line 88 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.X_test = np.zeros((n_testing, PATCH_SIZE_W, PATCH_SIZE_D, 1), dtype=np.float32) |
Definition at line 155 of file train_cnn_augmented_data.py.
train_cnn_augmented_data.X_train = np.zeros((n_training, PATCH_SIZE_W, PATCH_SIZE_D, 1), dtype=np.float32) |
Definition at line 129 of file train_cnn_augmented_data.py.