Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow as tf
- import keras.backend as K
- nonlabels = list(np.where(predictions<threshold)[1])
- loss_fg_nT = 0
- probs_nT = tf.gather(probs_fg,nonlabels,axis=3)
- for i in range(len(nonlabels)):
- probs_temp = tf.reshape(probs_nT[:,:,:,i],[-1])
- prob_max = tf.math.reduce_max(probs_temp)
- const = tf.constant(0.000001)
- prob_max = tf.math.add(prob_max, const)
- print(prob_max)
- print(K.eval(prob_max))
- prob_max = tf.math.subtract(tf.constant(1.0), prob_max)
- print(prob_max)
- print(K.eval(prob_max))
- val = K.log(prob_max)
Add Comment
Please, Sign In to add comment