diff --git a/python/paddle/trainer_config_helpers/layers.py b/python/paddle/trainer_config_helpers/layers.py index c506977ca4e405c6f2299641bc1ce1bf0c4dcb79..19f7ec3186596f2a9b028e71d78a9b2870cea659 100755 --- a/python/paddle/trainer_config_helpers/layers.py +++ b/python/paddle/trainer_config_helpers/layers.py @@ -71,7 +71,6 @@ __all__ = [ 'bilinear_interp_layer', 'trans_layer', 'rotate_layer', - 'flip_layer', 'sum_to_one_norm_layer', 'get_output_layer', 'LayerType', @@ -1720,46 +1719,6 @@ def rotate_layer(input, height, name=None, layer_attr=None): size=l.config.size) -@wrap_name_default() -@layer_support() -def flip_layer(input, height, name=None, layer_attr=None): - """ - A layer for flipping the matrix w.r.t the matrix center. - It's essentially rotating the matrix twice. - Used for input as image or map. - - .. math:: - y(i,j) = x(M-i-1, N-j-1) - - where :math:`x` is (M x N) input, and :math:`y` is (M x N) output. - - The example usage is: - - .. code-block:: python - - flip = flip_layer(input=layer, - height=100) - - :param input: Input layer. - :type input: LayerOutput - :param height: The height of the sample matrix - :type height: int - :param name: Layer name. - :type name: basestring - :param layer_attr: extra layer attributes. - :type layer_attr: ExtraLayerAttribute. - :return: LayerOutput object. - :rtype: LayerOutput - """ - assert isinstance(input, LayerOutput) - return rotate_layer( - input=rotate_layer( - input=input, height=height), - height=height, - name=name, - layer_attr=layer_attr) - - @wrap_name_default() @layer_support() def cos_sim(a, b, scale=1, size=1, name=None, layer_attr=None): diff --git a/python/paddle/trainer_config_helpers/tests/layers_test_config.py b/python/paddle/trainer_config_helpers/tests/layers_test_config.py index 3d417a00601d567d4b623ec6dbfdf6944d10a1b3..1964e6f113e6423018325ad87bd82b3d333b8868 100644 --- a/python/paddle/trainer_config_helpers/tests/layers_test_config.py +++ b/python/paddle/trainer_config_helpers/tests/layers_test_config.py @@ -40,7 +40,6 @@ assert z1.size > 0 y2 = fc_layer(input=y, size=15) z2 = rotate_layer(input=y2, height=5) -z3 = flip_layer(input=y2, height=3) cos1 = cos_sim(a=x1, b=y1) cos3 = cos_sim(a=x1, b=y2, size=3) @@ -48,7 +47,7 @@ cos3 = cos_sim(a=x1, b=y2, size=3) linear_comb = linear_comb_layer(weights=x1, vectors=y2, size=3) out = fc_layer( - input=[cos1, cos3, linear_comb, z, z1, z2, z3], + input=[cos1, cos3, linear_comb, z, z1, z2], size=num_classes, act=SoftmaxActivation())