parametric ReLU activation
(_x, scope='')
| 170 | return new_h, new_h |
| 171 | |
| 172 | def 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 | |
| 181 | def calc_auc(raw_arr): |
| 182 | """Summary |
no test coverage detected