Exemple #1
0
 def __init__(self, n_in, n_out, init_func, acti_func, W=None, b=None):
     super(DenseLayer, self).__init__()
     if W is None:
         W = init_func((n_in, n_out))
     if b is None:
         b = shared_zeros((n_out,))
     self.W = W
     self.b = b
     self.acti_func = acti_func
Exemple #2
0
 def __init__(self, filter_shape, init_func, acti_func, W=None, b=None, border_mode="valid"):
     '''
     border_mode is either valid or full.
     '''
     if W is None:
         W = init_func(filter_shape)
     if b is None:
         b = shared_zeros((filter_shape[0],))
     self.W = W
     self.b = b
     self.acti_func = acti_func
     self.filter_shape = filter_shape
     self.border_mode = border_mode