(self, model, input_size=None, rng=1234, dnn_type=True)
example model:
    model = [{"model_type": "conv", "filter_size": [5,5], "pool": [1,1], "stride": [1,1], "out_size": 5},
             {"model_type": "conv", "filter_size": [7,7], "pool": [1,1], "stride": [1,1], "out_size": 15},
             {"model_type": "mlp", "out_size": 300, "activation": "tanh"},
             {"model_type": "classification", "out_size": 10, "activation": "tanh", "loss_type": "log_loss"}]
example model:
    model = [{"model_type": "conv", "filter_size": [5,5], "pool": [1,1], "stride": [1,1], "out_size": 5},
             {"model_type": "conv", "filter_size": [7,7], "pool": [1,1], "stride": [1,1], "out_size": 15},
             {"model_type": "mlp", "out_size": 300, "activation": "tanh"},
             {"model_type": "classification", "out_size": 10, "activation": "tanh", "loss_type": "log_loss"}]
example model : model = [ { model_type : conv filter_size : [ 5 5 ] pool : [ 1 1 ] stride : [ 1 1 ] out_size : 5 } { model_type : conv filter_size : [ 7 7 ] pool : [ 1 1 ] stride : [ 1 1 ] out_size : 15 } { model_type : mlp out_size : 300 activation : tanh } { model_type : classification out_size : 10 activation : tanh loss_type : log_loss } ]
def __init__(self, model, input_size=None, rng=1234, dnn_type=True):
    """
    example model:
    model = [{"model_type": "conv", "filter_size": [5,5], "pool": [1,1], "stride": [1,1], "out_size": 5},
             {"model_type": "conv", "filter_size": [7,7], "pool": [1,1], "stride": [1,1], "out_size": 15},
             {"model_type": "mlp", "out_size": 300, "activation": "tanh"},
             {"model_type": "classification", "out_size": 10, "activation": "tanh", "loss_type": "log_loss"}]
    """
    rng = np.random.RandomState(rng)
    self.theano_rng = RandomStreams(rng.randint(2 ** 30))
    lasagne.random.set_rng(rng) #set rng

    new_layer = tuple(input_size) if isinstance(input_size, list) else input_size
    print model
    self.model = model
    self.input_size = input_size
    self.dnn_type = dnn_type

    # create neural net layers
    self.params = []
    self.layers = []
    for i, m in enumerate(model):
      new_layer = self.create_layer(new_layer, m, dnn_type=dnn_type)
      self.params += new_layer.get_params()
      self.layers.append(new_layer)
def __init__ ( self , model , input_size = None , rng = 1234 , dnn_type = True ) : rng = np . random . RandomState ( rng ) self . theano_rng = RandomStreams ( rng . randint ( 2 ** 30 ) ) lasagne . random . set_rng ( rng ) #set rng new_layer = tuple ( input_size ) if isinstance ( input_size , list ) else input_size print model self . model = model self . input_size = input_size self . dnn_type = dnn_type # create neural net layers self . params = [ ] self . layers = [ ] for i , m in enumerate ( model ) : new_layer = self . create_layer ( new_layer , m , dnn_type = dnn_type ) self . params += new_layer . get_params ( ) self . layers . append ( new_layer )