def get_variational_regularization(self, X): mean = self.activation(K.dot(X, self.W_mean) + self.b_mean) logsigma = self.activation(K.dot(X, self.W_logsigma) + self.b_logsigma) return GaussianKL(mean, logsigma, regularizer_scale=self.regularizer_scale, prior_mean=self.prior_mean, prior_logsigma=self.prior_logsigma)
def get_variational_regularization(self, X): X = K.reshape(X, (-1, self.input_shape[-1])) mean = self.activation(K.dot(X, self.W_mean) + self.b_mean) logsigma = self.activation(K.dot(X, self.W_logsigma) + self.b_logsigma) return GaussianKL(mean, logsigma, regularizer_scale=self.regularizer_scale, prior_mean=self.prior_mean, prior_logsigma=self.prior_logsigma)