diff --git a/tensorlayer/layers/convolution.py b/tensorlayer/layers/convolution.py index e313b221b..a103739fc 100644 --- a/tensorlayer/layers/convolution.py +++ b/tensorlayer/layers/convolution.py @@ -1382,6 +1382,8 @@ def deconv2d(layer, A :class:`DeConv2dLayer` object. """ + if act is None: + act = tf.identity assert len(strides) == 2, "len(strides) should be 2, DeConv2d and DeConv2dLayer are different." if tf.__version__ > '1.3': logging.info("DeConv2d %s: n_filters:%s strides:%s pad:%s act:%s" % (name, str(n_filter), str(strides), padding, act.__name__)) diff --git a/tensorlayer/layers/core.py b/tensorlayer/layers/core.py index 1b7b453b3..213335df9 100644 --- a/tensorlayer/layers/core.py +++ b/tensorlayer/layers/core.py @@ -69,7 +69,7 @@ def clear_layers_name(): Examples --------- - Reset the current graph and try to refine model. + Clean the current graph and try to re-define model. >>> for .... (different model settings): >>> with tf.Graph().as_default() as graph: # clear all variables of TF @@ -471,8 +471,7 @@ class OneHotInputLayer(Layer): depth : None or int If the input indices is rank N, the output will have rank N+1. The new axis is created at dimension `axis` (default: the new axis is appended at the end). on_value : None or number - The value to represnt `ON`. - - If None, it will default to the value 1. + The value to represnt `ON`. If None, it will default to the value 1. off_value : None or number The value to represnt `OFF`. If None, it will default to the value 0. axis : None or int @@ -913,7 +912,7 @@ class ReconLayer(DenseLayer): Methods ------- - pretrain(self, sess, x, X_train, X_val, denoise_name=None, n_epoch=100, batch_size=128, print_freq=10, save=True, save_name='w1pre') + pretrain(sess, x, X_train, X_val, denoise_name=None, n_epoch=100, batch_size=128, print_freq=10, save=True, save_name='w1pre') Start to pre-train the parameters of the previous DenseLayer. Notes diff --git a/tensorlayer/prepro.py b/tensorlayer/prepro.py index a9ef4bd8d..35d786d8d 100644 --- a/tensorlayer/prepro.py +++ b/tensorlayer/prepro.py @@ -148,13 +148,11 @@ def rotation(x, rg=20, is_random=False, row_index=0, col_index=1, channel_index= row_index col_index and channel_index : int Index of row, col and channel, default (0, 1, 2), for theano (1, 2, 0). fill_mode : str - Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap` - - `scipy ndimage affine_transform `__ + Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`, see `scipy ndimage affine_transform `__ cval : float Value used for points outside the boundaries of the input if mode=`constant`. Default is 0.0 order : int - The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform``. - - `scipy ndimage affine_transform `__ + The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform`` and `scipy ndimage affine_transform `__ Returns ------- @@ -398,13 +396,11 @@ def shift(x, wrg=0.1, hrg=0.1, is_random=False, row_index=0, col_index=1, channe row_index col_index and channel_index : int Index of row, col and channel, default (0, 1, 2), for theano (1, 2, 0). fill_mode : str - Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`. - - `scipy ndimage affine_transform `__ + Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`, see `scipy ndimage affine_transform `__ cval : float Value used for points outside the boundaries of the input if mode='constant'. Default is 0.0. order : int - The order of interpolation. The order has to be in the range 0-5. See ``apply_transform``. - - `scipy ndimage affine_transform `__ + The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform`` and `scipy ndimage affine_transform `__ Returns ------- @@ -473,13 +469,11 @@ def shear(x, intensity=0.1, is_random=False, row_index=0, col_index=1, channel_i row_index col_index and channel_index : int Index of row, col and channel, default (0, 1, 2), for theano (1, 2, 0). fill_mode : str - Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`. - - `scipy ndimage affine_transform `__ + Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`, see and `scipy ndimage affine_transform `__ cval : float Value used for points outside the boundaries of the input if mode='constant'. Default is 0.0. order : int - The order of interpolation. The order has to be in the range 0-5. See ``apply_transform``. - - `scipy ndimage affine_transform `__ + The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform`` and `scipy ndimage affine_transform `__ Returns ------- @@ -548,13 +542,11 @@ def shear2(x, shear=(0.1, 0.1), is_random=False, row_index=0, col_index=1, chann row_index col_index and channel_index : int Index of row, col and channel, default (0, 1, 2), for theano (1, 2, 0). fill_mode : str - Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`. - - `scipy ndimage affine_transform `__ + Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`, see `scipy ndimage affine_transform `__ cval : float Value used for points outside the boundaries of the input if mode='constant'. Default is 0.0. order : int - The order of interpolation. The order has to be in the range 0-5. See ``apply_transform``. - - `scipy ndimage affine_transform `__ + The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform`` and `scipy ndimage affine_transform `__ Returns ------- @@ -889,13 +881,11 @@ def zoom(x, zoom_range=(0.9, 1.1), is_random=False, row_index=0, col_index=1, ch row_index col_index and channel_index : int Index of row, col and channel, default (0, 1, 2), for theano (1, 2, 0). fill_mode : str - Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`. - - `scipy ndimage affine_transform `__ + Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`, see `scipy ndimage affine_transform `__ cval : float Value used for points outside the boundaries of the input if mode='constant'. Default is 0.0. order : int - The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform``. - - `scipy ndimage affine_transform `__ + The order of interpolation. The order has to be in the range 0-5. See ``tl.prepro.apply_transform`` and `scipy ndimage affine_transform `__ Returns ------- @@ -1631,8 +1621,7 @@ def apply_transform(x, transform_matrix, channel_index=2, fill_mode='nearest', c channel_index : int Index of channel, default 2. fill_mode : str - Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap` - - `scipy ndimage affine_transform `__ + Method to fill missing pixel, default `nearest`, more options `constant`, `reflect` or `wrap`, see `scipy ndimage affine_transform `__ cval : float Value used for points outside the boundaries of the input if mode='constant'. Default is 0.0 order : int