def _execute(self, x): if not self._is_initialized: self.initialize() n = x.shape[0] if n > 1: bias = numx.tile(self.b, (n, 1)) else: bias = self.b y = self.transfer_func.f(mult(x, self.w) + bias) return y
def _switchboard_grad(self, x): grad = numx.zeros((self.output_dim, self.input_dim)) grad[range(self.output_dim), self.connections] = 1 return numx.tile(grad, (len(x), 1, 1))