Commit 6e6addea authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

nitpick

parent aece6e1b
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import logging import logging
import tensorflow as tf import tensorflow as tf
logger = logging.getLogger("bob.learn.tensorflow") logger = logging.getLogger(__name__)
slim = tf.contrib.slim slim = tf.contrib.slim
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
import logging import logging
import tensorflow as tf import tensorflow as tf
from bob.learn.tensorflow.utils import ( from bob.learn.tensorflow.utils import compute_euclidean_distance
compute_euclidean_distance,
)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import logging import logging
import tensorflow as tf import tensorflow as tf
import functools import functools
logger = logging.getLogger("bob.learn.tensorflow") logger = logging.getLogger(__name__)
def content_loss(noises, content_features): def content_loss(noises, content_features):
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch> # @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
import logging import logging
logger = logging.getLogger("bob.learn.tensorflow") logger = logging.getLogger(__name__)
import tensorflow as tf import tensorflow as tf
from bob.learn.tensorflow.utils import compute_euclidean_distance from bob.learn.tensorflow.utils import compute_euclidean_distance
......
...@@ -2,6 +2,8 @@ import tensorflow as tf ...@@ -2,6 +2,8 @@ import tensorflow as tf
def compute_kernel(x, y): def compute_kernel(x, y):
"""Gaussian kernel.
"""
x_size = tf.shape(x)[0] x_size = tf.shape(x)[0]
y_size = tf.shape(y)[0] y_size = tf.shape(y)[0]
dim = tf.shape(x)[1] dim = tf.shape(x)[1]
...@@ -17,6 +19,9 @@ def compute_kernel(x, y): ...@@ -17,6 +19,9 @@ def compute_kernel(x, y):
def mmd(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) x_kernel = compute_kernel(x, x)
y_kernel = compute_kernel(y, y) y_kernel = compute_kernel(y, y)
xy_kernel = compute_kernel(x, y) xy_kernel = compute_kernel(x, y)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment