提交 e4828b7e 编写于 作者: Q qingqing01 提交者: GitHub

Merge pull request #2757 from lcy-seso/enable_error_clipping_for_fc

enable error_clipping in constructor of LayerBase
......@@ -1353,7 +1353,8 @@ class LayerBase(object):
device=None,
active_type="",
drop_rate=0.,
coeff=None):
coeff=None,
error_clipping_threshold=None):
config_assert('@' not in name,
"layer name: %s contain special character @" % name)
global g_current_submodel
......@@ -1387,6 +1388,9 @@ class LayerBase(object):
elif g_default_device is not None:
self.config.device = g_default_device
if error_clipping_threshold is not None:
self.config.error_clipping_threshold = error_clipping_threshold
for input_index in xrange(len(self.inputs)):
input = self.inputs[input_index]
input_config = None
......@@ -2782,13 +2786,7 @@ class TensorLayer(LayerBase):
@config_layer('mixed')
class MixedLayer(LayerBase):
def __init__(self,
name,
inputs,
size=0,
bias=True,
error_clipping_threshold=None,
**xargs):
def __init__(self, name, inputs, size=0, bias=True, **xargs):
config_assert(inputs, 'inputs cannot be empty')
super(MixedLayer, self).__init__(
name, 'mixed', size, inputs=inputs, **xargs)
......@@ -2870,9 +2868,6 @@ class MixedLayer(LayerBase):
self.config.bias_size = psize
self.create_bias_parameter(bias, psize)
if error_clipping_threshold is not None:
self.config.error_clipping_threshold = error_clipping_threshold
# like MixedLayer, but no bias parameter
@config_func
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册