{
  "id": 37163,
  "title": "Loss function unstable",
  "url": "/competitions/carvana-image-masking-challenge/discussion/37163",
  "author_name": "",
  "post_date": "2017-07-28T04:26:53.150716800Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hello,\nI'm trying to setup a loss function for a Deep Learning model as follows:</p>\n\n<pre><code>def Dice(input, target):\n  loss = -(2*(input*target).sum()/(input.sum() + target.sum())\n  return loss\n</code></pre>\n\n<p>But it's turning out to be very unstable, many times the weights just become zero killing the gradient.  </p>\n\n<p>What are you guys using as loss?</p>",
  "messages": [
    {
      "id": "207979",
      "postDate": "07/28/2017 04:26:53",
      "content": "<p>Hello,\nI'm trying to setup a loss function for a Deep Learning model as follows:</p>\n\n<pre><code>def Dice(input, target):\n  loss = -(2*(input*target).sum()/(input.sum() + target.sum())\n  return loss\n</code></pre>\n\n<p>But it's turning out to be very unstable, many times the weights just become zero killing the gradient.  </p>\n\n<p>What are you guys using as loss?</p>",
      "rawMarkdown": "Hello,\nI'm trying to setup a loss function for a Deep Learning model as follows:\n\n    def Dice(input, target):\n      loss = -(2*(input*target).sum()/(input.sum() + target.sum())\n      return loss\n\nBut it's turning out to be very unstable, many times the weights just become zero killing the gradient.  \n\nWhat are you guys using as loss?",
      "votes": null
    },
    {
      "id": "208016",
      "postDate": "07/28/2017 07:39:44",
      "content": "<p>Hi</p>\n\n<p>Take a look here\n<a href=\"https://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py\">https://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py</a></p>",
      "rawMarkdown": "Hi\n\nTake a look here\nhttps://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py",
      "votes": null
    },
    {
      "id": "208042",
      "postDate": "07/28/2017 10:48:38",
      "content": "<p>Thank you, I guess that the Smooth makes all the difference! </p>",
      "rawMarkdown": "Thank you, I guess that the Smooth makes all the difference!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 208016,
      "author_name": "venheads",
      "author_url": "",
      "post_date": "07/28/2017 07:39:44",
      "content": "<p>Hi</p>\n\n<p>Take a look here\n<a href=\"https://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py\">https://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 208042,
          "author_name": "felipesens",
          "author_url": "",
          "post_date": "07/28/2017 10:48:38",
          "content": "<p>Thank you, I guess that the Smooth makes all the difference! </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "207979": "Hello,\nI'm trying to setup a loss function for a Deep Learning model as follows:\n\n    def Dice(input, target):\n      loss = -(2*(input*target).sum()/(input.sum() + target.sum())\n      return loss\n\nBut it's turning out to be very unstable, many times the weights just become zero killing the gradient.  \n\nWhat are you guys using as loss?",
    "208016": "Hi\n\nTake a look here\nhttps://github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py",
    "208042": "Thank you, I guess that the Smooth makes all the difference!"
  },
  "source": "meta"
}