tpvt99 / character-recognition-cnn

Character Recognition using convolutional neural network with Tensfor flow
8 stars 3 forks source link

How to get Score(probability) of each classes #2

Open nandini123456 opened 6 years ago

nandini123456 commented 6 years ago

I have 36 classes 0-9 and A-Z.I need know the probability value of each classes during testing the trained model

tpvt99 commented 6 years ago

oh. If you want to know the probability of each values, I suggest you to make another variable in model() function: `` prob = tf.nn.softmax(Z) prob = tf.reduce_mean(prob, axis = 0, keepdims = True) init = tf.global_variables_initializer()

with tf.Session() as sess: sess.run(init) for epoch in range(epoches): for batch in mini_batches:

Do the training here

  # This is the place you put the code for prob:
  real_prob = sess.run(prob, feed_dict  = {X:X_batch, Y: Y_batch)
  print(real_prob) # print to see the probability
nandini123456 commented 6 years ago

Thank you

nandini123456 commented 6 years ago

I trying to add the drop out layer to each convolution layer, but i didn't know how to add that in forward propagation function. can you please help me out.

tpvt99 commented 6 years ago

Sure. Let me clone this project to my current host and I will try to rewrite this code. Wait me until tomorrow. I sure will have the edited part for you.

nandini123456 commented 6 years ago

Thank you

On Wed, Aug 8, 2018 at 10:10 AM, tpvt99 notifications@github.com wrote:

Sure. Let me clone this project to my current host and I will try to rewrite this code. Wait me until tomorrow. I sure will have the edited part for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tpvt99/character-recognition-cnn/issues/2#issuecomment-411282847, or mute the thread https://github.com/notifications/unsubscribe-auth/AfFIAcWEuN7vf_WK4mX7Xy2G7HUr77ilks5uOmupgaJpZM4VyCI4 .

tpvt99 commented 6 years ago

Hey. Do you mean that add drop out in convolutional layer? Dropout should be added in fully connected layers instead of convolutional layer? Please check again and send me some comments.