{
  "id": 27122,
  "title": "Classification vs Probability",
  "url": "/competitions/dogs-vs-cats-redux-kernels-edition/discussion/27122",
  "author_name": "AkshayAradhya",
  "post_date": "2016-12-30T15:08:45.127000",
  "votes": 0,
  "comment_count": 0,
  "views": 103,
  "content": "<p>I just wanted to know what is better using neural networks. </p>\n\n<p>Should I train my NN to output just 1 feature, probability of being a dog</p>\n\n<p><strong>OR</strong></p>\n\n<p>Should I train my NN to output just 2 feature, probabilities of dog and cat.\nIf i do this what is the best way to get the final probability. Should I do  <code>(dog-cat)/2 + 0.5</code> or some other kind of operation to get the final result ?</p>\n\n<p>Also what is better to calculate probability softmax or sigmoid ? Both of them seem to be returning 1 and 0</p>\n\n<p><strong>This is my Model :</strong></p>\n\n<pre><code>output_prediction = convolutional_neural_network()\nloss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(   \n                       output_prediction,output_placeholder) )\ntrainer = tf.train.AdamOptimizer()\noptimizer = trainer.minimize(loss)\ntest_prediction = tf.nn.softmax(output_prediction)\n</code></pre>",
  "messages": [
    {
      "id": 153237,
      "postDate": "2016-12-30T15:08:45.127Z",
      "content": "<p>I just wanted to know what is better using neural networks. </p>\n\n<p>Should I train my NN to output just 1 feature, probability of being a dog</p>\n\n<p><strong>OR</strong></p>\n\n<p>Should I train my NN to output just 2 feature, probabilities of dog and cat.\nIf i do this what is the best way to get the final probability. Should I do  <code>(dog-cat)/2 + 0.5</code> or some other kind of operation to get the final result ?</p>\n\n<p>Also what is better to calculate probability softmax or sigmoid ? Both of them seem to be returning 1 and 0</p>\n\n<p><strong>This is my Model :</strong></p>\n\n<pre><code>output_prediction = convolutional_neural_network()\nloss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(   \n                       output_prediction,output_placeholder) )\ntrainer = tf.train.AdamOptimizer()\noptimizer = trainer.minimize(loss)\ntest_prediction = tf.nn.softmax(output_prediction)\n</code></pre>",
      "rawMarkdown": "I just wanted to know what is better using neural networks. \r\n\r\nShould I train my NN to output just 1 feature, probability of being a dog\r\n\r\n**OR**\r\n\r\nShould I train my NN to output just 2 feature, probabilities of dog and cat.\r\nIf i do this what is the best way to get the final probability. Should I do  `(dog-cat)/2 + 0.5` or some other kind of operation to get the final result ?\r\n\r\nAlso what is better to calculate probability softmax or sigmoid ? Both of them seem to be returning 1 and 0\r\n\r\n**This is my Model :**\r\n\r\n    output_prediction = convolutional_neural_network()\r\n    loss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(   \r\n                           output_prediction,output_placeholder) )\r\n    trainer = tf.train.AdamOptimizer()\r\n    optimizer = trainer.minimize(loss)\r\n    test_prediction = tf.nn.softmax(output_prediction)\r\n\r\n"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "153237": "I just wanted to know what is better using neural networks. \r\n\r\nShould I train my NN to output just 1 feature, probability of being a dog\r\n\r\n**OR**\r\n\r\nShould I train my NN to output just 2 feature, probabilities of dog and cat.\r\nIf i do this what is the best way to get the final probability. Should I do  `(dog-cat)/2 + 0.5` or some other kind of operation to get the final result ?\r\n\r\nAlso what is better to calculate probability softmax or sigmoid ? Both of them seem to be returning 1 and 0\r\n\r\n**This is my Model :**\r\n\r\n    output_prediction = convolutional_neural_network()\r\n    loss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(   \r\n                           output_prediction,output_placeholder) )\r\n    trainer = tf.train.AdamOptimizer()\r\n    optimizer = trainer.minimize(loss)\r\n    test_prediction = tf.nn.softmax(output_prediction)\r\n\r\n"
  }
}