rinuboney / ladder

Ladder network is a deep learning algorithm that combines supervised and unsupervised learning.
MIT License
242 stars 92 forks source link

Definition of prediction cost and correct prediction -- only labelled? #15

Closed EvenStrangest closed 7 years ago

EvenStrangest commented 7 years ago

Shouldn't the definitions for prediction cost and correct prediction (see current definitions below) be changed to only include labelled examples?

pred_cost = -tf.reduce_mean(tf.reduce_sum(outputs*tf.log(y), 1))  # cost used for prediction
correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(outputs, 1))  # no of correct predictions
rinuboney commented 7 years ago

correct_prediction is only used for computing accuracy. In this script, the accuracy operator is only used for computing the accuracy of the model over the whole test. There are no unlabeled examples in this case. If it is used in other cases, then yes it should be computed only for labeled examples.