提交 075954c1 编写于 作者: C caoying03

follow comment.

上级 dc606711
...@@ -1353,7 +1353,8 @@ class LayerBase(object): ...@@ -1353,7 +1353,8 @@ class LayerBase(object):
device=None, device=None,
active_type="", active_type="",
drop_rate=0., drop_rate=0.,
coeff=None): coeff=None,
error_clipping_threshold=None):
config_assert('@' not in name, config_assert('@' not in name,
"layer name: %s contain special character @" % name) "layer name: %s contain special character @" % name)
global g_current_submodel global g_current_submodel
...@@ -1387,6 +1388,9 @@ class LayerBase(object): ...@@ -1387,6 +1388,9 @@ class LayerBase(object):
elif g_default_device is not None: elif g_default_device is not None:
self.config.device = g_default_device 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)): for input_index in xrange(len(self.inputs)):
input = self.inputs[input_index] input = self.inputs[input_index]
input_config = None input_config = None
...@@ -1571,13 +1575,7 @@ class MultiClassCrossEntropySelfNormCostLayer(LayerBase): ...@@ -1571,13 +1575,7 @@ class MultiClassCrossEntropySelfNormCostLayer(LayerBase):
@config_layer('fc') @config_layer('fc')
class FCLayer(LayerBase): class FCLayer(LayerBase):
def __init__(self, def __init__(self, name, size, inputs, bias=True, **xargs):
name,
size,
inputs,
bias=True,
error_clipping_threshold=None,
**xargs):
super(FCLayer, self).__init__(name, 'fc', size, inputs=inputs, **xargs) super(FCLayer, self).__init__(name, 'fc', size, inputs=inputs, **xargs)
for input_index in xrange(len(self.inputs)): for input_index in xrange(len(self.inputs)):
input_layer = self.get_input_layer(input_index) input_layer = self.get_input_layer(input_index)
...@@ -1595,9 +1593,6 @@ class FCLayer(LayerBase): ...@@ -1595,9 +1593,6 @@ class FCLayer(LayerBase):
format) format)
self.create_bias_parameter(bias, self.config.size) self.create_bias_parameter(bias, self.config.size)
if error_clipping_threshold is not None:
self.config.error_clipping_threshold = error_clipping_threshold
@config_layer('selective_fc') @config_layer('selective_fc')
class SelectiveFCLayer(LayerBase): class SelectiveFCLayer(LayerBase):
...@@ -2791,13 +2786,7 @@ class TensorLayer(LayerBase): ...@@ -2791,13 +2786,7 @@ class TensorLayer(LayerBase):
@config_layer('mixed') @config_layer('mixed')
class MixedLayer(LayerBase): class MixedLayer(LayerBase):
def __init__(self, def __init__(self, name, inputs, size=0, bias=True, **xargs):
name,
inputs,
size=0,
bias=True,
error_clipping_threshold=None,
**xargs):
config_assert(inputs, 'inputs cannot be empty') config_assert(inputs, 'inputs cannot be empty')
super(MixedLayer, self).__init__( super(MixedLayer, self).__init__(
name, 'mixed', size, inputs=inputs, **xargs) name, 'mixed', size, inputs=inputs, **xargs)
...@@ -2879,9 +2868,6 @@ class MixedLayer(LayerBase): ...@@ -2879,9 +2868,6 @@ class MixedLayer(LayerBase):
self.config.bias_size = psize self.config.bias_size = psize
self.create_bias_parameter(bias, 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 # like MixedLayer, but no bias parameter
@config_func @config_func
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册