{
  "id": 12791,
  "title": "Caffe? How to generate the prediction from caffe output?",
  "url": "/competitions/datasciencebowl/discussion/12791",
  "author_name": "",
  "post_date": "2015-03-13T03:44:02.577Z",
  "votes": null,
  "comment_count": 4,
  "views": 6158,
  "content": "<p>Hi,</p>\n<p>For those who use caffe, may I know which layer you used to generate the output? and how? and what is the difference between the loss value from caffe and leaderboard score?</p>\n\n<p>In my case, Caffe reports evaluation loss around 0.95, from a 0.8/0.2 split of training set.</p>\n\n<p>A) I have one submission from the softmax layer which seems contain only 1 and 0s , the loss from leaderboard is 28+&nbsp;</p>\n\n<p>B) Then I submit&nbsp; result from the last layer before softmax, which contains both - and + numbers,(eg,-199,+855..)&nbsp; the loss is 9+</p>\n<p>C) If I stretch B to [0,1], then loss is 4.5+</p>\n<p>D) Maybe I should use C/sum(C) ? But evaluation plan=&gt; they are rescaled prior to being scored (each row is divided by the row sum)..</p>\n\n<p>...</p>",
  "messages": [
    {
      "id": "66076",
      "postDate": "03/13/2015 03:44:02",
      "content": "<p>Hi,</p>\n<p>For those who use caffe, may I know which layer you used to generate the output? and how? and what is the difference between the loss value from caffe and leaderboard score?</p>\n\n<p>In my case, Caffe reports evaluation loss around 0.95, from a 0.8/0.2 split of training set.</p>\n\n<p>A) I have one submission from the softmax layer which seems contain only 1 and 0s , the loss from leaderboard is 28+&nbsp;</p>\n\n<p>B) Then I submit&nbsp; result from the last layer before softmax, which contains both - and + numbers,(eg,-199,+855..)&nbsp; the loss is 9+</p>\n<p>C) If I stretch B to [0,1], then loss is 4.5+</p>\n<p>D) Maybe I should use C/sum(C) ? But evaluation plan=&gt; they are rescaled prior to being scored (each row is divided by the row sum)..</p>\n\n<p>...</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66079",
      "postDate": "03/13/2015 05:23:42",
      "content": "<p>It seems that you're taking the output of a classifier which will take the softmax outputs(probabilities) and does an &quot;argmax&quot; on it to get the class with the largest probability/likelihood. You want just the raw softmax outputs.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "66091",
      "postDate": "03/13/2015 12:06:04",
      "content": "<p>HI, all</p>\n<p>Thanks for the hints, finally I made one successful submission today. loss=0.88</p>\n<p>The best approach is take the raw network output right before Caffe's softmax layer. And compute softmax value.</p>\n<p>For me I am using the Caffe matlab wrapper , so it is just one line of code,&nbsp;&nbsp; <a href=\"http://www.mathworks.com/help/nnet/ref/softmax.html\">softmax function </a></p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "110911",
      "postDate": "03/09/2016 16:40:39",
      "content": "<p>How is taking the raw network output right before Caffe's softmax layer and compute softmax different from just taking the output of the softmax layer?&nbsp;</p>\n<p>[quote=Steven Du;66091]</p>\n<p>HI, all</p>\n<p>Thanks for the hints, finally I made one successful submission today. loss=0.88</p>\n<p>The best approach is take the raw network output right before Caffe's softmax layer. And compute softmax value.</p>\n<p>For me I am using the Caffe matlab wrapper , so it is just one line of code,&nbsp;&nbsp; <a href=\"http://www.mathworks.com/help/nnet/ref/softmax.html\">softmax function </a></p>\n<p>[/quote]</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "111297",
      "postDate": "03/13/2016 12:48:07",
      "content": "<p>After the images in train.txt haven been trained, and the images in val.txt have been tested.\nHow to get the &quot;precision&quot; and &quot;recall&quot; from the val.txt file (which has been tested by Caffe model)?</p>",
      "rawMarkdown": "After the images in train.txt haven been trained, and the images in val.txt have been tested.\r\nHow to get the \"precision\" and \"recall\" from the val.txt file (which has been tested by Caffe model)?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 66079,
      "author_name": "zerozero",
      "author_url": "",
      "post_date": "03/13/2015 05:23:42",
      "content": "<p>It seems that you're taking the output of a classifier which will take the softmax outputs(probabilities) and does an &quot;argmax&quot; on it to get the class with the largest probability/likelihood. You want just the raw softmax outputs.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 66091,
      "author_name": "stevendu",
      "author_url": "",
      "post_date": "03/13/2015 12:06:04",
      "content": "<p>HI, all</p>\n<p>Thanks for the hints, finally I made one successful submission today. loss=0.88</p>\n<p>The best approach is take the raw network output right before Caffe's softmax layer. And compute softmax value.</p>\n<p>For me I am using the Caffe matlab wrapper , so it is just one line of code,&nbsp;&nbsp; <a href=\"http://www.mathworks.com/help/nnet/ref/softmax.html\">softmax function </a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 110911,
      "author_name": "ilovesolder",
      "author_url": "",
      "post_date": "03/09/2016 16:40:39",
      "content": "<p>How is taking the raw network output right before Caffe's softmax layer and compute softmax different from just taking the output of the softmax layer?&nbsp;</p>\n<p>[quote=Steven Du;66091]</p>\n<p>HI, all</p>\n<p>Thanks for the hints, finally I made one successful submission today. loss=0.88</p>\n<p>The best approach is take the raw network output right before Caffe's softmax layer. And compute softmax value.</p>\n<p>For me I am using the Caffe matlab wrapper , so it is just one line of code,&nbsp;&nbsp; <a href=\"http://www.mathworks.com/help/nnet/ref/softmax.html\">softmax function </a></p>\n<p>[/quote]</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 111297,
      "author_name": "yingyijeniffer",
      "author_url": "",
      "post_date": "03/13/2016 12:48:07",
      "content": "<p>After the images in train.txt haven been trained, and the images in val.txt have been tested.\nHow to get the &quot;precision&quot; and &quot;recall&quot; from the val.txt file (which has been tested by Caffe model)?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "66076": "",
    "66079": "",
    "66091": "",
    "110911": "",
    "111297": "After the images in train.txt haven been trained, and the images in val.txt have been tested.\r\nHow to get the \"precision\" and \"recall\" from the val.txt file (which has been tested by Caffe model)?"
  },
  "source": "meta"
}