Guest User

Untitled

a guest
Nov 6th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import tensorflow as tf
  2. import keras.backend as K
  3.  
  4. nonlabels = list(np.where(predictions<threshold)[1])
  5. loss_fg_nT = 0
  6. probs_nT = tf.gather(probs_fg,nonlabels,axis=3)
  7. for i in range(len(nonlabels)):
  8.     probs_temp = tf.reshape(probs_nT[:,:,:,i],[-1])
  9.     prob_max = tf.math.reduce_max(probs_temp)
  10.     const = tf.constant(0.000001)
  11.     prob_max = tf.math.add(prob_max, const)
  12.     print(prob_max)
  13.     print(K.eval(prob_max))
  14.     prob_max = tf.math.subtract(tf.constant(1.0), prob_max)
  15.     print(prob_max)
  16.     print(K.eval(prob_max))
  17.     val = K.log(prob_max)
Add Comment
Please, Sign In to add comment