提交 b4c1d175 编写于 作者: H Haonan

remove flip_layer

上级 55eb2fcf
......@@ -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):
......
......@@ -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())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册