ref: https://github.com/XJTUWYD/TWN Computing the threshold.
(x)
| 417 | |
| 418 | |
| 419 | def _compute_threshold(x): |
| 420 | """ |
| 421 | ref: https://github.com/XJTUWYD/TWN |
| 422 | Computing the threshold. |
| 423 | """ |
| 424 | x_sum = tf.reduce_sum(input_tensor=tf.abs(x), axis=None, keepdims=False, name=None) |
| 425 | # threshold = tf.compat.v1.div(x_sum, tf.cast(tf.size(input=x), tf.float32), name=None) |
| 426 | threshold = tf.math.divide(x_sum, tf.cast(tf.size(input=x), tf.float32), name=None) |
| 427 | threshold = tf.multiply(0.7, threshold, name=None) |
| 428 | return threshold |
no outgoing calls
no test coverage detected
searching dependent graphs…