{
  "id": 208498,
  "title": "[Tips]  Various Loss Functions for Pytorch",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/208498",
  "author_name": "",
  "post_date": "2021-01-03T18:01:24.822390100Z",
  "votes": 42,
  "comment_count": 8,
  "views": 0,
  "content": "<h1>Introduction</h1>\n<p>Many loss functions were introduced in the cassava competition.</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202017\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202017</a></li>\n<li><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/203271\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/203271</a></li>\n<li><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/208239\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/208239</a></li>\n</ul>\n<h1>Implementation for Pytorch</h1>\n<p>I just added various loss functions to the existing my train notebook.<br>\n<a href=\"https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs\" target=\"_blank\">https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs</a></p>\n<p>following loss functions was added in <a href=\"https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs\" target=\"_blank\">my notebook</a>:</p>\n<ul>\n<li>CrossEntropyLoss</li>\n<li>LabelSmoothing</li>\n<li>FocalLoss</li>\n<li>FocalCosineLoss</li>\n<li>SymmetricCrossEntropyLoss</li>\n<li>BiTemperedLoss</li>\n</ul>\n<h2>Updated Verion - V8</h2>\n<ul>\n<li>TaylorCrossEntropyLoss</li>\n</ul>\n<p><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/209782\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/209782</a></p>\n<h1>End</h1>\n<p>I hope this will be helpful to the competition.<br>\nThnaks.</p>",
  "messages": [
    {
      "id": "1137149",
      "postDate": "01/03/2021 18:01:24",
      "content": "<h1>Introduction</h1>\n<p>Many loss functions were introduced in the cassava competition.</p>\n<ul>\n<li><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202017\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202017</a></li>\n<li><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/203271\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/203271</a></li>\n<li><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/208239\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/208239</a></li>\n</ul>\n<h1>Implementation for Pytorch</h1>\n<p>I just added various loss functions to the existing my train notebook.<br>\n<a href=\"https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs\" target=\"_blank\">https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs</a></p>\n<p>following loss functions was added in <a href=\"https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs\" target=\"_blank\">my notebook</a>:</p>\n<ul>\n<li>CrossEntropyLoss</li>\n<li>LabelSmoothing</li>\n<li>FocalLoss</li>\n<li>FocalCosineLoss</li>\n<li>SymmetricCrossEntropyLoss</li>\n<li>BiTemperedLoss</li>\n</ul>\n<h2>Updated Verion - V8</h2>\n<ul>\n<li>TaylorCrossEntropyLoss</li>\n</ul>\n<p><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/209782\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/209782</a></p>\n<h1>End</h1>\n<p>I hope this will be helpful to the competition.<br>\nThnaks.</p>",
      "rawMarkdown": "# Introduction\n\nMany loss functions were introduced in the cassava competition.\n- https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202017\n- https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/203271\n- https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/208239\n\n# Implementation for Pytorch\nI just added various loss functions to the existing my train notebook.\nhttps://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs\n\nfollowing loss functions was added in [my notebook](https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs):\n- CrossEntropyLoss\n- LabelSmoothing\n- FocalLoss\n- FocalCosineLoss\n- SymmetricCrossEntropyLoss\n- BiTemperedLoss\n\n## Updated Verion - V8\n- TaylorCrossEntropyLoss\n\nhttps://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/209782\n\n# End\nI hope this will be helpful to the competition.\nThnaks.",
      "votes": null
    },
    {
      "id": "1137401",
      "postDate": "01/03/2021 22:27:38",
      "content": "<p>Hey, thanks for sharing! I was wondering something:<br>\nHow to properly estimate the values for T1 and T2 of the Bi-Tempered Loss function besides trial and error?</p>",
      "rawMarkdown": "Hey, thanks for sharing! I was wondering something:\nHow to properly estimate the values for T1 and T2 of the Bi-Tempered Loss function besides trial and error?",
      "votes": null
    },
    {
      "id": "1138399",
      "postDate": "01/04/2021 16:58:46",
      "content": "<p>I think that experiment is needed. :)</p>",
      "rawMarkdown": "I think that experiment is needed. :)",
      "votes": null
    },
    {
      "id": "1143236",
      "postDate": "01/07/2021 20:00:26",
      "content": "<p>Great as always👌</p>",
      "rawMarkdown": "Great as always👌",
      "votes": null
    },
    {
      "id": "1144224",
      "postDate": "01/08/2021 10:28:52",
      "content": "<p><a href=\"https://www.kaggle.com/piantic\" target=\"_blank\">@piantic</a> Great share!<br>\nAre you aware of any implementation of HD loss and Boundary loss?</p>",
      "rawMarkdown": "piantic Great share!\nAre you aware of any implementation of HD loss and Boundary loss?",
      "votes": null
    },
    {
      "id": "1164443",
      "postDate": "01/22/2021 11:25:57",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/heroseo\" target=\"_blank\">@heroseo</a> thanks for the wonderful share again . I was wondering if you tried all of the loses yourself and if you can share the results , it would be great</p>",
      "rawMarkdown": "Hi @heroseo thanks for the wonderful share again . I was wondering if you tried all of the loses yourself and if you can share the results , it would be great",
      "votes": null
    },
    {
      "id": "1164924",
      "postDate": "01/22/2021 16:11:00",
      "content": "<p>The discussion for criterion has been still valid for me. :)<br>\n<a href=\"https://www.kaggle.com/tanulsingh077\" target=\"_blank\">@tanulsingh077</a> </p>\n<p><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/207450\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/207450</a></p>",
      "rawMarkdown": "The discussion for criterion has been still valid for me. :)\n@tanulsingh077 \n\nhttps://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/207450",
      "votes": null
    },
    {
      "id": "1164926",
      "postDate": "01/22/2021 16:13:12",
      "content": "<p>I am now focusing on the experiment. :)</p>",
      "rawMarkdown": "I am now focusing on the experiment. :)",
      "votes": null
    },
    {
      "id": "1168769",
      "postDate": "01/25/2021 06:48:29",
      "content": "<p>Thanks a lot for sharing..Very helpful.</p>",
      "rawMarkdown": "Thanks a lot for sharing..Very helpful.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1137401,
      "author_name": "capiru",
      "author_url": "",
      "post_date": "01/03/2021 22:27:38",
      "content": "<p>Hey, thanks for sharing! I was wondering something:<br>\nHow to properly estimate the values for T1 and T2 of the Bi-Tempered Loss function besides trial and error?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1138399,
          "author_name": "piantic",
          "author_url": "",
          "post_date": "01/04/2021 16:58:46",
          "content": "<p>I think that experiment is needed. :)</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1143236,
      "author_name": "vahidehdashti",
      "author_url": "",
      "post_date": "01/07/2021 20:00:26",
      "content": "<p>Great as always👌</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1144224,
      "author_name": "prvnkmr",
      "author_url": "",
      "post_date": "01/08/2021 10:28:52",
      "content": "<p><a href=\"https://www.kaggle.com/piantic\" target=\"_blank\">@piantic</a> Great share!<br>\nAre you aware of any implementation of HD loss and Boundary loss?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1164926,
          "author_name": "piantic",
          "author_url": "",
          "post_date": "01/22/2021 16:13:12",
          "content": "<p>I am now focusing on the experiment. :)</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1164443,
      "author_name": "tanulsingh077",
      "author_url": "",
      "post_date": "01/22/2021 11:25:57",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/heroseo\" target=\"_blank\">@heroseo</a> thanks for the wonderful share again . I was wondering if you tried all of the loses yourself and if you can share the results , it would be great</p>",
      "votes": null,
      "replies": [
        {
          "id": 1164924,
          "author_name": "piantic",
          "author_url": "",
          "post_date": "01/22/2021 16:11:00",
          "content": "<p>The discussion for criterion has been still valid for me. :)<br>\n<a href=\"https://www.kaggle.com/tanulsingh077\" target=\"_blank\">@tanulsingh077</a> </p>\n<p><a href=\"https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/207450\" target=\"_blank\">https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/207450</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1168769,
      "author_name": "geekysaint",
      "author_url": "",
      "post_date": "01/25/2021 06:48:29",
      "content": "<p>Thanks a lot for sharing..Very helpful.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1137149": "# Introduction\n\nMany loss functions were introduced in the cassava competition.\n- https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/202017\n- https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/203271\n- https://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/208239\n\n# Implementation for Pytorch\nI just added various loss functions to the existing my train notebook.\nhttps://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs\n\nfollowing loss functions was added in [my notebook](https://www.kaggle.com/piantic/train-cassava-starter-using-various-loss-funcs):\n- CrossEntropyLoss\n- LabelSmoothing\n- FocalLoss\n- FocalCosineLoss\n- SymmetricCrossEntropyLoss\n- BiTemperedLoss\n\n## Updated Verion - V8\n- TaylorCrossEntropyLoss\n\nhttps://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/209782\n\n# End\nI hope this will be helpful to the competition.\nThnaks.",
    "1137401": "Hey, thanks for sharing! I was wondering something:\nHow to properly estimate the values for T1 and T2 of the Bi-Tempered Loss function besides trial and error?",
    "1138399": "I think that experiment is needed. :)",
    "1143236": "Great as always👌",
    "1144224": "piantic Great share!\nAre you aware of any implementation of HD loss and Boundary loss?",
    "1164443": "Hi @heroseo thanks for the wonderful share again . I was wondering if you tried all of the loses yourself and if you can share the results , it would be great",
    "1164924": "The discussion for criterion has been still valid for me. :)\n@tanulsingh077 \n\nhttps://www.kaggle.com/c/cassava-leaf-disease-classification/discussion/207450",
    "1164926": "I am now focusing on the experiment. :)",
    "1168769": "Thanks a lot for sharing..Very helpful."
  },
  "source": "meta"
}