#!/usr/bin/env python from yann.network import network from yann.utils.pickle import load import time import sys #run = 1 dataset = sys.argv[1] momentum = "nesterov" optim = "rmsprop" lr = (0.01, 0.005, 0.001) params = load('network_dataset_96731.pkl') # create a network net = network() dataset_params = {"dataset": dataset, "id": 'svhn', "n_classes": 10} net.add_layer(type="input", id="input", dataset_init_args=dataset_params) # adding layers net.add_layer(type="conv_pool", origin="input", id="conv_pool_1", num_neurons=20, filter_size=(5, 5), pool_size=(2, 2), batch_norm=True, activation='relu', input_params=params['conv_pool_1'], learnable=False)
epochs = (40, 40) p_vals = [0, 10, 50, 100, 500, 1000, 2500, 4700] #p_vals = [0] # setup incremental dataset parameters dataset. """temp_splits = { "shot" : [6,7,8,9], "base" : [0,1,2,3,4,5], "p" : 0 }""" temp_base_data = inc_dataset( #splits = temp_splits, verbose=1) temp_base_data = temp_base_data.dataset_location() site2 = igan(init_dataset=temp_base_data, root=root, verbose=1) print(". Setup transfered gan network from site 1.") gan_params = load(site_1_root + '/resultor/gan/params/epoch_' + str(gan) + '.pkl') site2.setup_gan(dataset=temp_base_data, root=root, params=gan_params, cook=False, verbose=1) print(". Setup transfered base network from site 1.") base_params = load(site_1_root + '/resultor/base-network/params/epoch_99.pkl') site2.setup_base_mlp(dataset=temp_base_data, root=root, params=base_params, cook=False, verbose=1)
"batches2validate": 2, "mini_batch_size": 500 } # setup incremental dataset parameters dataset. temp_splits = {"shot": [6, 7, 8, 9], "base": [0, 1, 2, 3, 4, 5], "p": 0} temp_base_data = inc_dataset(splits=temp_splits, data_params=temp_data_params, location=data_loc, verbose=1) temp_base_data = temp_base_data.dataset_location() site2 = igan(init_dataset=temp_base_data, root=root, verbose=1) print(". Setup transfered gan network from site 1.") gan_params = load(site_1_root + '/resultor/gan/params/gan-5-31.pkl') site2.setup_gan(dataset=temp_base_data, root=root, params=gan_params, cook=False, verbose=1) print(". Setup transfered base network from site 1.") base_params = load(site_1_root + '/resultor/base-network/params/epoch_9.pkl') site2.setup_base_mlp(dataset=temp_base_data, root=root, params=base_params, cook=False, verbose=1)
#!/usr/bin/env python from yann.network import network from yann.utils.pickle import load import time import sys #run = 1 dataset = sys.argv[1] momentum = "nesterov" optim = "rmsprop" lr = (0.01, 0.005, 0.001) params = load('network_dataset_90998.pkl') # create a network net = network() dataset_params = {"dataset": dataset, "id": 'svhn', "n_classes": 10} net.add_layer(type="input", id="input", dataset_init_args=dataset_params) # adding layers net.add_layer(type="conv_pool", origin="input", id="conv_pool_1", num_neurons=20, filter_size=(5, 5), pool_size=(2, 2), batch_norm=True, activation='relu', input_params=params['conv_pool_1'], learnable=False)
#!/usr/bin/env python from yann.network import network from yann.utils.pickle import load import time import sys #run = 1 dataset = sys.argv[1] momentum = "nesterov" optim = "rmsprop" lr = (0.01, 0.005, 0.001) params = load('network_dataset_32589.pkl') # create a network net = network() dataset_params = {"dataset": dataset, "id": 'svhn', "n_classes": 10} net.add_layer(type="input", id="input", dataset_init_args=dataset_params) # adding layers net.add_layer(type="conv_pool", origin="input", id="conv_pool_1", num_neurons=20, filter_size=(5, 5), pool_size=(2, 2), batch_norm=True, activation='relu', input_params=params['conv_pool_1'], learnable=False)
def test_load(self, mock_open, mock_shared_params, mock_load): util_pickle.load('file', verbose=3) self.assertTrue(mock_load.called) self.assertTrue(mock_shared_params.called) self.assertTrue(mock_open.called)
import theano print("Theano Default Device: ") print(theano.config.device) import sys # For CLI args from yann.network import network net = network() dataset_params = {"dataset": sys.argv[2], "id": 'mnist', "n_classes": 10} # Begin ConvNet Setup using old params # Load already trained params from yann.utils.pickle import load parts = sys.argv[1].split('/') load_str = 'network' + parts[1] + '.pkl' print "Loading Network From: " + load_str old_params = load(load_str) print "Old Layers: " print old_params.keys() net.add_layer(type="input", id="input", dataset_init_args=dataset_params) net.add_layer(type="conv_pool", origin="input", id="conv_pool_1", num_neurons=20, filter_size=(5, 5), pool_size=(2, 2), activation=('maxout', 'maxout', 2), batch_norm=True, regularize=True, verbose=True,