2323import theano .tensor as T
2424from theano .tensor .shared_randomstreams import RandomStreams
2525
26- from utils .load_conf import load_model ,load_conv_spec ,load_mlp_spec , load_data_spec
26+ from utils .load_conf import load_model ,load_conv_spec ,load_data_spec
2727from io_modules .file_reader import read_dataset
2828from utils .learn_rates import LearningRate
2929from utils .utils import parse_activation
@@ -43,8 +43,10 @@ def runCNN(arg):
4343 else :
4444 model_config = load_model (arg ,'CNN' )
4545
46- conv_config ,conv_layer_config ,mlp_config = load_conv_spec (model_config ['nnet_spec' ],model_config ['batch_size' ],
47- model_config ['input_shape' ])
46+ conv_config ,conv_layer_config ,mlp_config = load_conv_spec (
47+ model_config ['nnet_spec' ],
48+ model_config ['batch_size' ],
49+ model_config ['input_shape' ])
4850
4951 data_spec = load_data_spec (model_config ['data_spec' ]);
5052
@@ -59,6 +61,7 @@ def runCNN(arg):
5961 createDir (model_config ['wdir' ]);
6062 #create working dir
6163
64+ batch_size = model_config ['batch_size' ];
6265 cnn = CNN (numpy_rng ,theano_rng ,conv_layer_configs = conv_layer_config , batch_size = batch_size ,
6366 n_outs = model_config ['n_outs' ],hidden_layers_sizes = mlp_config ['layers' ],
6467 conv_activation = conv_activation ,hidden_activation = hidden_activation ,
@@ -68,7 +71,6 @@ def runCNN(arg):
6871
6972 #learning rate, batch-size and momentum
7073 lrate = LearningRate .get_instance (model_config ['l_rate_method' ],model_config ['l_rate' ]);
71- batch_size = model_config ['batch_size' ];
7274 momentum = model_config ['momentum' ]
7375
7476 train_sets , train_xy , train_x , train_y = read_dataset (data_spec ['training' ],model_config ['batch_size' ])
0 commit comments