{
  "id": 254724,
  "title": "Loss function 🤔",
  "url": "/competitions/rsna-miccai-brain-tumor-radiogenomic-classification/discussion/254724",
  "author_name": "",
  "post_date": "2021-07-23T11:28:34.254311300Z",
  "votes": 4,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Dear all,<br>\nI am quite new to such competitions, but I want to ask one basic question:<br>\nWhat kind of activation + loss function do we need to use, sigmoid  with BCE loss where the num_classes = 1, or softmax + Cross entropy with num_classes = 2 ? Since I saw that there are Kaggle notebooks in this competition where each of the approaches are used  , and we have study-level labels and binary classification problem 🤔 (its obvious to me that we need to use BCE + sigmoid)<br>\nAny answers are appreciated 😊 !</p>",
  "messages": [
    {
      "id": "1397646",
      "postDate": "07/23/2021 11:28:34",
      "content": "<p>Dear all,<br>\nI am quite new to such competitions, but I want to ask one basic question:<br>\nWhat kind of activation + loss function do we need to use, sigmoid  with BCE loss where the num_classes = 1, or softmax + Cross entropy with num_classes = 2 ? Since I saw that there are Kaggle notebooks in this competition where each of the approaches are used  , and we have study-level labels and binary classification problem 🤔 (its obvious to me that we need to use BCE + sigmoid)<br>\nAny answers are appreciated 😊 !</p>",
      "rawMarkdown": "Dear all,\nI am quite new to such competitions, but I want to ask one basic question:\nWhat kind of activation + loss function do we need to use, sigmoid  with BCE loss where the num_classes = 1, or softmax + Cross entropy with num_classes = 2 ? Since I saw that there are Kaggle notebooks in this competition where each of the approaches are used  , and we have study-level labels and binary classification problem 🤔 (its obvious to me that we need to use BCE + sigmoid)\nAny answers are appreciated 😊 !",
      "votes": null
    },
    {
      "id": "1398483",
      "postDate": "07/24/2021 07:58:34",
      "content": "<p>I am using BCE with logit loss, in pytorch,( with n_class =1)</p>",
      "rawMarkdown": "I am using BCE with logit loss, in pytorch,( with n_class =1)",
      "votes": null
    },
    {
      "id": "1398522",
      "postDate": "07/24/2021 08:43:39",
      "content": "<p>thats my last layer:</p>\n<p>tf.keras.layers.Dense(1, activation='sigmoid')</p>\n<p>and I use</p>\n<p>tf.keras.losses.BinaryCrossentropy()</p>",
      "rawMarkdown": "thats my last layer:\n\ntf.keras.layers.Dense(1, activation='sigmoid')\n\nand I use\n\ntf.keras.losses.BinaryCrossentropy()",
      "votes": null
    },
    {
      "id": "1398610",
      "postDate": "07/24/2021 10:27:20",
      "content": "<p>Tnx :), it was helpful !</p>",
      "rawMarkdown": "Tnx :), it was helpful !",
      "votes": null
    },
    {
      "id": "1398611",
      "postDate": "07/24/2021 10:28:45",
      "content": "<p>Tnx mate !</p>",
      "rawMarkdown": "Tnx mate !",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1398483,
      "author_name": "mrinath",
      "author_url": "",
      "post_date": "07/24/2021 07:58:34",
      "content": "<p>I am using BCE with logit loss, in pytorch,( with n_class =1)</p>",
      "votes": null,
      "replies": [
        {
          "id": 1398611,
          "author_name": "marjan1111",
          "author_url": "",
          "post_date": "07/24/2021 10:28:45",
          "content": "<p>Tnx mate !</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1398522,
      "author_name": "lucamtb",
      "author_url": "",
      "post_date": "07/24/2021 08:43:39",
      "content": "<p>thats my last layer:</p>\n<p>tf.keras.layers.Dense(1, activation='sigmoid')</p>\n<p>and I use</p>\n<p>tf.keras.losses.BinaryCrossentropy()</p>",
      "votes": null,
      "replies": [
        {
          "id": 1398610,
          "author_name": "marjan1111",
          "author_url": "",
          "post_date": "07/24/2021 10:27:20",
          "content": "<p>Tnx :), it was helpful !</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1397646": "Dear all,\nI am quite new to such competitions, but I want to ask one basic question:\nWhat kind of activation + loss function do we need to use, sigmoid  with BCE loss where the num_classes = 1, or softmax + Cross entropy with num_classes = 2 ? Since I saw that there are Kaggle notebooks in this competition where each of the approaches are used  , and we have study-level labels and binary classification problem 🤔 (its obvious to me that we need to use BCE + sigmoid)\nAny answers are appreciated 😊 !",
    "1398483": "I am using BCE with logit loss, in pytorch,( with n_class =1)",
    "1398522": "thats my last layer:\n\ntf.keras.layers.Dense(1, activation='sigmoid')\n\nand I use\n\ntf.keras.losses.BinaryCrossentropy()",
    "1398610": "Tnx :), it was helpful !",
    "1398611": "Tnx mate !"
  },
  "source": "meta"
}