MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / prelu

Function prelu

modelzoo/features/multihash_variable/dien/script/utils.py:172–179  ·  view source on GitHub ↗

parametric ReLU activation

(_x, scope='')

Source from the content-addressed store, hash-verified

170 return new_h, new_h
171
172def prelu(_x, scope=''):
173 """parametric ReLU activation"""
174 with tf.variable_scope(name_or_scope=scope, default_name="prelu"):
175 _alpha = tf.get_variable("prelu_"+scope, shape=_x.get_shape()[-1],
176 dtype=_x.dtype, initializer=tf.constant_initializer(0.1))
177 _zero = tf.constant(0,dtype=_x.dtype)
178 # return tf.maximum(0.0, _x) + _alpha * tf.minimum(0.0, _x)
179 return tf.maximum(_zero, _x) + _alpha * tf.minimum(_zero, _x)
180
181def calc_auc(raw_arr):
182 """Summary

Callers 5

din_fcn_attentionFunction · 0.70
din_fcn_shineFunction · 0.70
build_fcn_netMethod · 0.70
build_fcn_net_bf16Method · 0.70
build_graphFunction · 0.50

Calls 6

variable_scopeMethod · 0.80
maximumMethod · 0.80
minimumMethod · 0.80
get_variableMethod · 0.45
get_shapeMethod · 0.45
constantMethod · 0.45

Tested by

no test coverage detected