From f903bce7fad0dde62eb4fe0c7c585e3a3b3a5201 Mon Sep 17 00:00:00 2001 From: hanjr92 Date: Fri, 27 May 2022 15:34:57 +0800 Subject: [PATCH] del quantize --- tensorlayerx/metrics/tensorflow_metric.py | 2 +- tensorlayerx/nn/layers/__init__.py | 1 - tensorlayerx/nn/layers/quantize.py | 50 ----------------------- 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 tensorlayerx/nn/layers/quantize.py diff --git a/tensorlayerx/metrics/tensorflow_metric.py b/tensorlayerx/metrics/tensorflow_metric.py index 22ec853..fd2efa3 100644 --- a/tensorlayerx/metrics/tensorflow_metric.py +++ b/tensorlayerx/metrics/tensorflow_metric.py @@ -257,7 +257,7 @@ class Recall(object): """ Recall score for binary classification task. - Examples + Examples ----------- >>> import tensorlayerx as tlx >>> y_pred = tlx.ops.convert_to_tensor(np.array([0.3, 0.2, 0.1, 0.7])) diff --git a/tensorlayerx/nn/layers/__init__.py b/tensorlayerx/nn/layers/__init__.py index d4e33ff..2f21d39 100644 --- a/tensorlayerx/nn/layers/__init__.py +++ b/tensorlayerx/nn/layers/__init__.py @@ -16,7 +16,6 @@ from .normalization import * from .padding import * from .pooling import * -from .quantize import * from .recurrent import * from .scale import * from .shape import * diff --git a/tensorlayerx/nn/layers/quantize.py b/tensorlayerx/nn/layers/quantize.py deleted file mode 100644 index deecd26..0000000 --- a/tensorlayerx/nn/layers/quantize.py +++ /dev/null @@ -1,50 +0,0 @@ -#! /usr/bin/python -# -*- coding: utf-8 -*- - -from tensorlayerx import logging -from tensorlayerx.nn.core import Module -from tensorlayerx.nn.layers.utils import quantize - -__all__ = [ - 'Sign', -] - - -class Sign(Module): - """The :class:`SignLayer` class is for quantizing the layer outputs to -1 or 1 while inferencing. - - Parameters - ---------- - name : a str - A unique layer name. - - """ - - # @deprecated_alias(layer='prev_layer', end_support_version=1.9) # TODO remove this line for the 1.9 release - def __init__( - self, - name=None # 'sign', - ): - super().__init__(name) - logging.info("Sign %s" % self.name) - - self.build() - self._built = True - - def build(self, inputs_shape=None): - pass - - def __repr__(self): - s = ('{classname}(') - if self.name is not None: - s += ', name=\'{name}\'' - s += ')' - return s.format(classname=self.__class__.__name__, **self.__dict__) - - def forward(self, inputs): - outputs = quantize(inputs) - - if not self._nodes_fixed and self._build_graph: - self._add_node(inputs, outputs) - self._nodes_fixed = True - return outputs