Skip to content
Snippets Groups Projects
Commit 6e6addea authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

nitpick

parent aece6e1b
No related branches found
No related tags found
1 merge request!79Add keras-based models, add pixel-wise loss, other improvements
......@@ -4,7 +4,7 @@
import logging
import tensorflow as tf
logger = logging.getLogger("bob.learn.tensorflow")
logger = logging.getLogger(__name__)
slim = tf.contrib.slim
......
......@@ -4,9 +4,7 @@
import logging
import tensorflow as tf
from bob.learn.tensorflow.utils import (
compute_euclidean_distance,
)
from bob.learn.tensorflow.utils import compute_euclidean_distance
logger = logging.getLogger(__name__)
......
......@@ -5,7 +5,7 @@
import logging
import tensorflow as tf
import functools
logger = logging.getLogger("bob.learn.tensorflow")
logger = logging.getLogger(__name__)
def content_loss(noises, content_features):
......
......@@ -3,7 +3,7 @@
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
import logging
logger = logging.getLogger("bob.learn.tensorflow")
logger = logging.getLogger(__name__)
import tensorflow as tf
from bob.learn.tensorflow.utils import compute_euclidean_distance
......
......@@ -2,6 +2,8 @@ import tensorflow as tf
def compute_kernel(x, y):
"""Gaussian kernel.
"""
x_size = tf.shape(x)[0]
y_size = tf.shape(y)[0]
dim = tf.shape(x)[1]
......@@ -17,6 +19,9 @@ def compute_kernel(x, y):
def mmd(x, y):
"""Maximum Mean Discrepancy with Gaussian kernel.
See: https://stats.stackexchange.com/a/276618/49433
"""
x_kernel = compute_kernel(x, x)
y_kernel = compute_kernel(y, y)
xy_kernel = compute_kernel(x, y)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment