Ejemplo n.º 1
0
 def _decode(self, input) :
     from nn.layer import Layer
     weightsBack = self._getWeightsBack()
     deconvolve = conv2d(input, weightsBack, self.getFeatureSize(),
                         tuple(weightsBack.shape.eval()),
                         border_mode='full')
     out = deconvolve + self._thresholdsBack.dimshuffle('x', 0, 'x', 'x')
     return Layer._setActivation(self, out)
Ejemplo n.º 2
0
 def _setActivation(self, out) :
     from nn.layer import Layer
     from theano.tensor import round
     act = Layer._setActivation(self, out)
     return round(act, mode='half_away_from_zero') \
            if self._forceSparse else act