b2e6cccd53bd6c076c32421b8c4d562a96437524,tensorlayer/layers/normalization.py,LayerNormLayer,__init__,#LayerNormLayer#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,228
Before Change
begin_params_axis=-1,
name="layernorm"):
if tf.__version__ < "1.3":
raise Exception("Please use TF 1.3+")
Layer.__init__(self, name=name)
self.inputs = layer.outputs
logging.info("LayerNormLayer %s: act:%s" % (self.name, act.__name__))
with tf.variable_scope(name) as vs:
self.outputs = tf.contrib.layers.layer_norm(
self.inputs,
center=center,
scale=scale,
activation_fn=act,
reuse=reuse,
variables_collections=variables_collections,
outputs_collections=outputs_collections,
trainable=trainable,
begin_norm_axis=begin_norm_axis,
begin_params_axis=begin_params_axis,
scope="var",
)
variables = tf.get_collection(TF_GRAPHKEYS_VARIABLES, scope=vs.name)
self.all_layers = list(layer.all_layers)
self.all_params = list(layer.all_params)
self.all_drop = dict(layer.all_drop)
self.all_layers.extend([self.outputs])
self.all_params.extend(variables)
After Change
if tf.__version__ < "1.3":
// raise Exception("Please use TF 1.3+")
with tf.variable_scope(name) as vs:
self.outputs = tf.contrib.layers.layer_norm(
self.inputs,
center=center,
scale=scale,
activation_fn=act,
reuse=reuse,
variables_collections=variables_collections,
outputs_collections=outputs_collections,
trainable=trainable,
// begin_norm_axis=begin_norm_axis,
// begin_params_axis=begin_params_axis,
scope="var",
)
variables = tf.get_collection(TF_GRAPHKEYS_VARIABLES, scope=vs.name)
else:
with tf.variable_scope(name) as vs:
self.outputs = tf.contrib.layers.layer_norm(
self.inputs,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: tensorlayer/tensorlayer
Commit Name: b2e6cccd53bd6c076c32421b8c4d562a96437524
Time: 2018-03-10
Author: dhsig552@163.com
File Name: tensorlayer/layers/normalization.py
Class Name: LayerNormLayer
Method Name: __init__
Project Name: asyml/texar
Commit Name: da37438735fd4b845bb0874562bd071865c480bb
Time: 2018-03-17
Author: zhitinghu@gmail.com
File Name: texar/modules/encoders/rnn_encoders.py
Class Name: RNNEncoderBase
Method Name: __init__
Project Name: asyml/texar
Commit Name: 133d8b4c1b22c639359202ba55d828bed7ddff47
Time: 2018-05-03
Author: zhitinghu@gmail.com
File Name: texar/modules/decoders/beam_search_decode.py
Class Name:
Method Name: beam_search_decode