Пример #1
0
 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
Пример #2
0
def sum_mse(y_true, y_pred):
    return K.sqr(y_true - y_pred).sum()
Пример #3
0
 def func(y_true, y_pred):
     return K.sum(K.exp(-K.sqr(y_true - y_pred)/sigma))
Пример #4
0
        def loss(x):
            x_rec, _, _ = self.mcmc_chain(x, nb_gibbs_steps)

            return K.mean(K.sqr(x - x_rec))
Пример #5
0
def sum_mse(y_true, y_pred):
    return K.sqr(y_true - y_pred).sum()
Пример #6
0
 def func(y_true, y_pred):
     return -K.mean(K.exp(-K.sqr(y_true - y_pred) / sigma), -1)
Пример #7
0
 def func(y_true, y_pred):
     return -K.mean(K.exp(-K.sqr(y_true - y_pred)/sigma), -1)
Пример #8
0
        def loss(x):
            x_rec, _, _ = self.mcmc_chain(x, nb_gibbs_steps)

            return K.mean(K.sqr(x - x_rec))