Exemplo n.º 1
0
Arquivo: bm.py Projeto: 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()
Exemplo n.º 2
0
Arquivo: conv.py Projeto: zeka0/ether
 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'])
Exemplo n.º 3
0
Arquivo: conv.py Projeto: zeka0/ether
 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'])
Exemplo n.º 4
0
Arquivo: bm.py Projeto: 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()
Exemplo n.º 5
0
 def init_bias(self):
     self.b = init_shared(shape=(self.numOfOutput, ), **self.biasKwargs)
Exemplo n.º 6
0
 def init_weights(self):
     self.W = init_shared(shape=self.get_weightShape(), **self.weightKwargs)
Exemplo n.º 7
0
Arquivo: rbf.py Projeto: zeka0/ether
 def init_kernels(self, numOfConnections):
     self.kernels = init_shared(shape=numOfConnections, **self.kernelKwargs)
Exemplo n.º 8
0
 def init_kernels(self, numOfConnections):
     self.kernels = init_shared(shape=numOfConnections, **self.kernelKwargs)
Exemplo n.º 9
0
Arquivo: conv.py Projeto: zeka0/ether
 def init_filters(self):
     self.filters = []
     for i in xrange(self.get_numOfFilters()):
         self.filters.append(
             init_shared(shape=self.get_filterShape(), **self.filterKwargs))
Exemplo n.º 10
0
Arquivo: conv.py Projeto: zeka0/ether
 def init_bias(self):
     self.bias = init_shared(**self.biasKwargs)
Exemplo n.º 11
0
Arquivo: conv.py Projeto: zeka0/ether
 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)
Exemplo n.º 12
0
Arquivo: conv.py Projeto: zeka0/ether
 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)
Exemplo n.º 13
0
Arquivo: conv.py Projeto: zeka0/ether
 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)
Exemplo n.º 14
0
Arquivo: conv.py Projeto: zeka0/ether
 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)
Exemplo n.º 15
0
Arquivo: conv.py Projeto: zeka0/ether
 def init_filters(self):
     self.filters = []
     for i in xrange(self.get_numOfFilters()):
         self.filters.append( init_shared(shape=self.get_filterShape(), **self.filterKwargs) )
Exemplo n.º 16
0
Arquivo: conv.py Projeto: zeka0/ether
 def init_bias(self):
     self.bias = init_shared(**self.biasKwargs)