Commit ea72b276 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

isort -sl -rc .

parent 9f2c4abf
import tensorflow as tf
import numpy
import os
import numpy
import tensorflow as tf
import bob.io.base
DEFAULT_FEATURE = {
......
import tensorflow as tf
import random
import logging
import random
import tensorflow as tf
logger = logging.getLogger(__name__)
......
......@@ -2,9 +2,12 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
import tensorflow as tf
from functools import partial
from . import append_image_augmentation, from_filename_to_tensor
import tensorflow as tf
from . import append_image_augmentation
from . import from_filename_to_tensor
def shuffle_data_and_labels_image_augmentation(
......
......@@ -4,16 +4,15 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from functools import partial
import json
import logging
import os
from functools import partial
import tensorflow as tf
from . import DEFAULT_FEATURE
logger = logging.getLogger(__name__)
TFRECORDS_EXT = ".tfrecords"
......
from . import spectral_normalization
from . import losses
from . import spectral_normalization
......@@ -29,7 +29,8 @@ import re
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.keras.engine import base_layer_utils as keras_base_layer_utils
from tensorflow.python.keras.engine import \
base_layer_utils as keras_base_layer_utils
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import math_ops
......
from .filter import gaussian_kernel, GaussianFilter
from .filter import GaussianFilter
from .filter import gaussian_kernel
# gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
......
......@@ -3,6 +3,7 @@
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
import logging
import tensorflow as tf
logger = logging.getLogger(__name__)
......
......@@ -3,7 +3,9 @@
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
import logging
import tensorflow as tf
from bob.learn.tensorflow.utils import compute_euclidean_distance
logger = logging.getLogger(__name__)
......
......@@ -2,9 +2,10 @@
# vim: set fileencoding=utf-8 :
# @author: Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
import functools
import logging
import tensorflow as tf
import functools
logger = logging.getLogger(__name__)
......
# from .BaseLoss import mean_cross_entropy_loss, mean_cross_entropy_center_loss
from .ContrastiveLoss import contrastive_loss
from .TripletLoss import triplet_loss, triplet_average_loss, triplet_fisher_loss
from .StyleLoss import linear_gram_style_loss, content_loss, denoising_loss
from .vat import VATLoss
from .pixel_wise import PixelWise
from .center_loss import CenterLoss
from .ContrastiveLoss import contrastive_loss
from .mmd import *
from .pairwise_confusion import total_pairwise_confusion
from .pixel_wise import PixelWise
from .StyleLoss import content_loss
from .StyleLoss import denoising_loss
from .StyleLoss import linear_gram_style_loss
from .TripletLoss import triplet_average_loss
from .TripletLoss import triplet_fisher_loss
from .TripletLoss import triplet_loss
from .utils import *
from .vat import VATLoss
# gets sphinx autodoc done right - don't remove it
......
import tensorflow as tf
# TODO(amir): replace parent class with tf.Module in tensorflow 1.14 and above.
# * pass ``name`` to parent class
# * replace get_variable with tf.Variable
......
import tensorflow as tf
from ..utils import pdist_safe, upper_triangle
from ..utils import pdist_safe
from ..utils import upper_triangle
def total_pairwise_confusion(prelogits, name=None):
......
from ..dataset import tf_repeat
from .utils import (
balanced_softmax_cross_entropy_loss_weights,
balanced_sigmoid_cross_entropy_loss_weights,
)
import tensorflow as tf
from ..dataset import tf_repeat
from .utils import balanced_sigmoid_cross_entropy_loss_weights
from .utils import balanced_softmax_cross_entropy_loss_weights
class PixelWise:
"""A pixel wise loss which is just a cross entropy loss but applied to all pixels"""
......
......@@ -23,9 +23,10 @@
# SOFTWARE.
import tensorflow as tf
from functools import partial
import tensorflow as tf
def get_normalized_vector(d):
d /= 1e-12 + tf.reduce_max(
......
......@@ -62,6 +62,7 @@ def AlexNet_simplified(name="AlexNet", **kwargs):
if __name__ == "__main__":
import pkg_resources
from bob.learn.tensorflow.utils import model_summary
model = AlexNet_simplified()
......
......@@ -4,6 +4,7 @@ Mohammadi, Amir and Bhattacharjee, Sushil and Marcel, Sebastien, ICASSP 2020
"""
import tensorflow as tf
from bob.learn.tensorflow.models.densenet import densenet161
......@@ -114,6 +115,7 @@ def autoencoder_face(z_dim=256, weight_decay=1e-10, decoder_last_act="tanh"):
if __name__ == "__main__":
import pkg_resources
from tabulate import tabulate
from bob.learn.tensorflow.utils import model_summary
model = ConvDecoder(z_dim=256, weight_decay=1e-9, last_act="tanh", name="Decoder")
......
......@@ -3,6 +3,7 @@ Reference [Densely Connected Convolutional Networks](https://arxiv.org/abs/1608.
"""
import tensorflow as tf
from bob.extension import rc
l2 = tf.keras.regularizers.l2
......@@ -448,6 +449,7 @@ class DeepPixBiS(tf.keras.Model):
if __name__ == "__main__":
import pkg_resources
from tabulate import tabulate
from bob.learn.tensorflow.utils import model_summary
def print_model(inputs, outputs):
......
......@@ -144,6 +144,7 @@ def GoogLeNet(*, num_classes=1000, name="GoogLeNet", **kwargs):
if __name__ == "__main__":
import pkg_resources
from tabulate import tabulate
from bob.learn.tensorflow.utils import model_summary
inputs = tf.keras.Input((28, 28, 192), name="input")
......
# -*- coding: utf-8 -*-
"""Inception-ResNet-V2 MultiScale-Inception-ResNet-V2 models for Keras.
"""
from tensorflow.keras.models import Model
from tensorflow.keras.layers import (
Activation,
BatchNormalization,
Concatenate,
Conv2D,
Dense,
Dropout,
Input,
Lambda,
MaxPool2D,
AvgPool2D,
GlobalAvgPool2D,
GlobalMaxPool2D,
)
from tensorflow.keras import backend as K
import tensorflow as tf
import logging
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import AvgPool2D
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import Concatenate
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout
from tensorflow.keras.layers import GlobalAvgPool2D
from tensorflow.keras.layers import GlobalMaxPool2D
from tensorflow.keras.layers import Input
from tensorflow.keras.layers import Lambda
from tensorflow.keras.layers import MaxPool2D
from tensorflow.keras.models import Model
logger = logging.getLogger(__name__)
......@@ -696,6 +695,7 @@ def MultiScaleInceptionResNetV2(
if __name__ == "__main__":
import pkg_resources
from tabulate import tabulate
from bob.learn.tensorflow.utils import model_summary
def print_model(inputs, outputs, name=None):
......
Supports Markdown
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