def get_output(self, train): import theano.tensor as T X = self.get_input(train) input_dim = X.shape half_n = self.n // 2 input_sqr = K.sqr(X) b, ch, r, c = input_dim extra_channels = T.alloc(0., b, ch + 2 * half_n, r, c) input_sqr = K.set_subtensor( extra_channels[:, half_n:half_n + ch, :, :], input_sqr) scale = self.k norm_alpha = self.alpha / self.n for i in range(self.n): scale += norm_alpha * input_sqr[:, i:i + ch, :, :] scale = scale**self.beta return X / scale
def sum_mse(y_true, y_pred): return K.sqr(y_true - y_pred).sum()
def func(y_true, y_pred): return K.sum(K.exp(-K.sqr(y_true - y_pred)/sigma))
def loss(x): x_rec, _, _ = self.mcmc_chain(x, nb_gibbs_steps) return K.mean(K.sqr(x - x_rec))
def func(y_true, y_pred): return -K.mean(K.exp(-K.sqr(y_true - y_pred) / sigma), -1)
def func(y_true, y_pred): return -K.mean(K.exp(-K.sqr(y_true - y_pred)/sigma), -1)