{
  "id": 377817,
  "title": "Questions about WeightedRandomSampler",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/377817",
  "author_name": "Leimeng46",
  "post_date": "2023-01-13T00:23:31.262000",
  "votes": 2,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Thesedays I've tried <strong>WeightedRandomSampler</strong> to handle the imbalance. Maybe my understanding is not praticularly deep. I just use WeightedRandomSampler in my training set instead of valid set. And I didn't use it in my inference. I don't know if it is right. Hope someone can give me some advice.</p>",
  "messages": [
    {
      "id": 2097972,
      "postDate": "2023-01-13T05:48:29.477Z",
      "content": "<p>It is ok. You can use Weighted Sampler (or other sampling methods) for training and then Sequential Sampler (in pytorch default DL settings) for validation (to have consistent validation score).</p>",
      "rawMarkdown": "It is ok. You can use Weighted Sampler (or other sampling methods) for training and then Sequential Sampler (in pytorch default DL settings) for validation (to have consistent validation score).",
      "votes": 1,
      "replies": [
        {
          "id": 2098001,
          "postDate": "2023-01-13T06:15:09.870Z",
          "content": "<p>Thanks, Remek Kinas. I'll try Sequential Sampler later.</p>",
          "rawMarkdown": "Thanks, Remek Kinas. I'll try Sequential Sampler later.",
          "replies": [
            {
              "id": 2098005,
              "postDate": "2023-01-13T06:21:25.527Z",
              "content": "<p>Seq sampler is by default in loader. It process inputs always the same way - the order is in line with the order in dataset.</p>",
              "rawMarkdown": "Seq sampler is by default in loader. It process inputs always the same way - the order is in line with the order in dataset."
            }
          ]
        }
      ]
    },
    {
      "id": 2097811,
      "postDate": "2023-01-13T00:23:31.263Z",
      "content": "<p>Thesedays I've tried <strong>WeightedRandomSampler</strong> to handle the imbalance. Maybe my understanding is not praticularly deep. I just use WeightedRandomSampler in my training set instead of valid set. And I didn't use it in my inference. I don't know if it is right. Hope someone can give me some advice.</p>",
      "rawMarkdown": "Thesedays I've tried **WeightedRandomSampler** to handle the imbalance. Maybe my understanding is not praticularly deep. I just use WeightedRandomSampler in my training set instead of valid set. And I didn't use it in my inference. I don't know if it is right. Hope someone can give me some advice.",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 2097972,
      "author_name": "Remek Kinas",
      "author_url": "",
      "post_date": "2023-01-13T05:48:29.477000",
      "content": "<p>It is ok. You can use Weighted Sampler (or other sampling methods) for training and then Sequential Sampler (in pytorch default DL settings) for validation (to have consistent validation score).</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2098001,
          "author_name": "Leimeng46",
          "author_url": "",
          "post_date": "2023-01-13T06:15:09.870000",
          "content": "<p>Thanks, Remek Kinas. I'll try Sequential Sampler later.</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2098005,
              "author_name": "Remek Kinas",
              "author_url": "",
              "post_date": "2023-01-13T06:21:25.527000",
              "content": "<p>Seq sampler is by default in loader. It process inputs always the same way - the order is in line with the order in dataset.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2097972": "It is ok. You can use Weighted Sampler (or other sampling methods) for training and then Sequential Sampler (in pytorch default DL settings) for validation (to have consistent validation score).",
    "2097811": "Thesedays I've tried **WeightedRandomSampler** to handle the imbalance. Maybe my understanding is not praticularly deep. I just use WeightedRandomSampler in my training set instead of valid set. And I didn't use it in my inference. I don't know if it is right. Hope someone can give me some advice."
  }
}