Пример #1
0
Файл: bm.py Проект: zeka0/ether
    def __init__(self,
                 n_visible,
                 n_hidden,
                 train_k=1,
                 sample_k=1000,
                 theano_rng=None,
                 persistent=None,
                 **kwargs):
        self.n_visible = n_visible
        self.n_hidden = n_hidden

        if theano_rng is None:
            theano_rng = RandomStreams(np.random.randint(2**30))
        assert kwargs.has_key('weight')
        assert kwargs.has_key('hbias')
        assert kwargs.has_key('vbias')
        assert not kwargs['weight'].has_key('shape')
        assert not kwargs['vbias'].has_key('shape')
        assert not kwargs['hbias'].has_key('shape')

        self.W = init_shared(shape=(n_visible, n_hidden), **kwargs['weight'])
        self.hbias = init_shared(shape=(n_hidden, ), **kwargs['hbias'])
        self.vbias = init_shared(shape=(n_visible, ), **kwargs['vbias'])
        self.theano_rng = theano_rng
        self.persistent = persistent
        self.train_k = train_k
        self.sample_k = sample_k
        self.input = T.matrix()
Пример #2
0
 def __init__(self, subSampleShape, **kwargs):
     layer.__init__(self)
     assert len(subSampleShape) == 2
     self.subSampleShape = subSampleShape
     assert kwargs.has_key('coef')
     assert kwargs.has_key('bias')
     self.coef = init_shared(**kwargs['coef'])
     self.bias = init_shared(**kwargs['bias'])
Пример #3
0
 def __init__(self, subSampleShape, **kwargs):
     layer.__init__(self)
     assert len(subSampleShape) == 2
     self.subSampleShape = subSampleShape
     assert kwargs.has_key('coef')
     assert kwargs.has_key('bias')
     self.coef = init_shared(**kwargs['coef'])
     self.bias = init_shared(**kwargs['bias'])
Пример #4
0
Файл: bm.py Проект: zeka0/ether
    def __init__(self,
                 n_visible, n_hidden, train_k=1, sample_k=1000,
                 theano_rng=None, persistent=None,
                 **kwargs):
        self.n_visible = n_visible
        self.n_hidden = n_hidden

        if theano_rng is None:
            theano_rng = RandomStreams(np.random.randint(2**30))
        assert kwargs.has_key('weight')
        assert kwargs.has_key('hbias')
        assert kwargs.has_key('vbias')
        assert not kwargs['weight'].has_key('shape')
        assert not kwargs['vbias'].has_key('shape')
        assert not kwargs['hbias'].has_key('shape')

        self.W = init_shared(shape=(n_visible, n_hidden), **kwargs['weight'] )
        self.hbias = init_shared(shape=(n_hidden,), **kwargs['hbias'] )
        self.vbias = init_shared(shape=(n_visible,), **kwargs['vbias'] )
        self.theano_rng = theano_rng
        self.persistent = persistent
        self.train_k = train_k
        self.sample_k = sample_k
        self.input = T.matrix()
Пример #5
0
 def init_bias(self):
     self.b = init_shared(shape=(self.numOfOutput, ), **self.biasKwargs)
Пример #6
0
 def init_weights(self):
     self.W = init_shared(shape=self.get_weightShape(), **self.weightKwargs)
Пример #7
0
Файл: rbf.py Проект: zeka0/ether
 def init_kernels(self, numOfConnections):
     self.kernels = init_shared(shape=numOfConnections, **self.kernelKwargs)
Пример #8
0
 def init_kernels(self, numOfConnections):
     self.kernels = init_shared(shape=numOfConnections, **self.kernelKwargs)
Пример #9
0
 def init_filters(self):
     self.filters = []
     for i in xrange(self.get_numOfFilters()):
         self.filters.append(
             init_shared(shape=self.get_filterShape(), **self.filterKwargs))
Пример #10
0
 def init_bias(self):
     self.bias = init_shared(**self.biasKwargs)
Пример #11
0
 def init_filters(self, n_pre_fm):
     self.filterShape = (self.n_fm, n_pre_fm) + self.filterDs
     self.filters = init_shared(shape=self.get_filterShape(),
                                **self.filterKwargs)
Пример #12
0
 def init_bias(self):
     '''
     :var n_fm means the number of this layer's feature maps
     '''
     self.bias = init_shared(shape=(self.n_fm, ), **self.biasKwargs)
Пример #13
0
 def init_filters(self, n_pre_fm):
     self.filterShape = (self.n_fm, n_pre_fm) + self.filterDs
     self.filters = init_shared(shape=self.get_filterShape(), **self.filterKwargs)
Пример #14
0
 def init_bias(self):
     '''
     :var n_fm means the number of this layer's feature maps
     '''
     self.bias = init_shared(shape=(self.n_fm,), **self.biasKwargs)
Пример #15
0
 def init_filters(self):
     self.filters = []
     for i in xrange(self.get_numOfFilters()):
         self.filters.append( init_shared(shape=self.get_filterShape(), **self.filterKwargs) )
Пример #16
0
 def init_bias(self):
     self.bias = init_shared(**self.biasKwargs)