提交 59bfa3e8 编写于 作者: H haonanyu

fix a bug of sub() in layer_math.py

上级 d50016b2
......@@ -75,7 +75,7 @@ LayerOutput.__add__ = add
def sub(layeroutput, other):
if is_compatible_with(other, float):
return slope_intercept_layer(input=layeroutput, intercept=other)
return slope_intercept_layer(input=layeroutput, intercept=-other)
if not isinstance(other, LayerOutput):
logger.fatal("LayerOutput can only be subtracted with"
" another Layeroutput or a number")
......
......@@ -230,7 +230,7 @@ layers {
input_layer_name: "__mixed_1__"
}
slope: 1.0
intercept: 2
intercept: -2
}
layers {
name: "__slope_intercept_layer_4__"
......@@ -411,4 +411,3 @@ sub_models {
output_layer_names: "__mixed_3__"
is_recurrent_layer_group: false
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册