from __future__ import print_function from keras.optimizers import SGD, RMSprop from cnn_functions import rate_scheduler, train_model_sample from model_zoo import feature_net_61x61 as the_model import os import datetime import numpy as np batch_size = 256 n_classes = 3 n_epoch = 25 model = the_model(n_channels=2, n_features=3, reg=1e-4, drop=0.5) dataset = "nuclei_all_61x61" direc_save = "/home/nquach/DeepCell2/trained_networks/" direc_data = "/home/nquach/DeepCell2/training_data_npz/" optimizer = RMSprop(lr=0.001, rho=0.95, epsilon=1e-8) lr_sched = rate_scheduler(lr=0.001, decay=0.95) expt = "feature_net_61x61_drop_reg4" iterate = 4 train_model_sample(model=model, dataset=dataset, optimizer=optimizer, expt=expt, it=iterate, batch_size=batch_size, n_epoch=n_epoch,
from __future__ import print_function from keras.optimizers import SGD, RMSprop from cnn_functions import rate_scheduler, train_model_sample from model_zoo import feature_net_61x61 as the_model import os import datetime import numpy as np batch_size = 256 n_classes = 3 n_epoch = 25 model = the_model(n_channels=2, n_features=3, reg=0, drop=0) dataset = "HeLa_all_61x61" direc_save = "/home/nquach/DeepCell2/trained_networks/" direc_data = "/home/nquach/DeepCell2/training_data_npz/" optimizer = RMSprop(lr=0.001, rho=0.95, epsilon=1e-8) lr_sched = rate_scheduler(lr=0.001, decay=0.95) expt = "feature_net_61x61_reg0" iterate = 0 train_model_sample(model=model, dataset=dataset, optimizer=optimizer, expt=expt, it=iterate, batch_size=batch_size, n_epoch=n_epoch,
from __future__ import print_function from keras.optimizers import SGD, RMSprop from cnn_functions import rate_scheduler, train_model_sample from model_zoo import bn_feature_net_61x61 as the_model import os import datetime import numpy as np batch_size = 256 n_classes = 3 n_epoch = 25 model = the_model(n_channels=2, n_features=3, reg=1e-5) dataset = "HeLa_set3_61x61" direc_save = "/home/nquach/DeepCell2/trained_networks/" direc_data = "/home/nquach/DeepCell2/training_data_npz/" optimizer = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) lr_sched = rate_scheduler(lr=0.01, decay=0.95) expt = "bn_61x61_HeLa_set3" iterate = 1 train_model_sample(model=model, dataset=dataset, optimizer=optimizer, expt=expt, it=iterate, batch_size=batch_size, n_epoch=n_epoch,
data_location = os.path.join(direc_name, 'RawImages') output_location = os.path.join(direc_name, 'Output') channel_names = ['Phase', 'Far-red'] win_x = 30 win_y = 30 image_size_x, image_size_y = get_image_sizes(data_location, channel_names) image_size_x /= 2 image_size_y /= 2 """ Define model """ trained_network_directory = "/home/vanvalen/DeepCell2/trained_networks/" file_name_save = os.path.join(trained_network_directory, "2016-07-12_HeLa_all_61x61_bn_shear_0.h5") model = the_model(batch_input_shape=(1, 2, image_size_x + win_x, image_size_y + win_x), weights_path=file_name_save) """ Run model on directory """ run_model_on_directory(data_location, channel_names, output_location, model=model, win_x=win_x, win_y=win_y, std=False)