{
  "id": 218269,
  "title": "A Pytorch template for beginners and advanced users",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/218269",
  "author_name": "",
  "post_date": "2021-02-10T01:13:31.869207700Z",
  "votes": 4,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I put together a Pytorch based template that users could use for experimentation, training and inference which was not specific to any competition. </p>\n<p>After defining the specific dataset related options, a user can then experiment with the following features:</p>\n<ul>\n<li><p>Get list of models via --find_model eg. --find_model se<em>resnet</em>50</p></li>\n<li><p>Testing a sample of data via --n_samples to make sure main code works fine for changes</p></li>\n<li><p>Testing augmentation visually via --test_loader and changing the augments in the get_sample_transforms function. I noticed that a lot of people dont really look at the details of the augmentations and this helps quickly look at what they are really doing</p></li>\n<li><p>Providing a scheduler or loss function via --scheduler  / --loss_fn  </p></li>\n<li><p>Optionally get noisy labels using CleanLab (<a href=\"https://github.com/cgnorthcutt/cleanlab\" target=\"_blank\">https://github.com/cgnorthcutt/cleanlab</a>)</p></li>\n<li><p>Save best model for each epoch and each fold</p></li>\n<li><p>Support for upsampling/downsampling</p></li>\n<li><p>Optional Cutmix (per batch with 25% probability)</p></li>\n<li><p>Optional SVM head on CNN model</p></li>\n</ul>\n<p><strong>The script saves all states for reproducibility in the future - eg. List. ofcommand line arguments, list of config options, augmentations performed, scores etc</strong></p>\n<p><strong>Notebook:</strong><br>\n<a href=\"https://www.kaggle.com/trushk/a-pytorch-template-for-experimentation\" target=\"_blank\">https://www.kaggle.com/trushk/a-pytorch-template-for-experimentation</a></p>\n<p>Feedback/comments welcome! </p>",
  "messages": [
    {
      "id": "1193922",
      "postDate": "02/10/2021 01:13:31",
      "content": "<p>I put together a Pytorch based template that users could use for experimentation, training and inference which was not specific to any competition. </p>\n<p>After defining the specific dataset related options, a user can then experiment with the following features:</p>\n<ul>\n<li><p>Get list of models via --find_model eg. --find_model se<em>resnet</em>50</p></li>\n<li><p>Testing a sample of data via --n_samples to make sure main code works fine for changes</p></li>\n<li><p>Testing augmentation visually via --test_loader and changing the augments in the get_sample_transforms function. I noticed that a lot of people dont really look at the details of the augmentations and this helps quickly look at what they are really doing</p></li>\n<li><p>Providing a scheduler or loss function via --scheduler  / --loss_fn  </p></li>\n<li><p>Optionally get noisy labels using CleanLab (<a href=\"https://github.com/cgnorthcutt/cleanlab\" target=\"_blank\">https://github.com/cgnorthcutt/cleanlab</a>)</p></li>\n<li><p>Save best model for each epoch and each fold</p></li>\n<li><p>Support for upsampling/downsampling</p></li>\n<li><p>Optional Cutmix (per batch with 25% probability)</p></li>\n<li><p>Optional SVM head on CNN model</p></li>\n</ul>\n<p><strong>The script saves all states for reproducibility in the future - eg. List. ofcommand line arguments, list of config options, augmentations performed, scores etc</strong></p>\n<p><strong>Notebook:</strong><br>\n<a href=\"https://www.kaggle.com/trushk/a-pytorch-template-for-experimentation\" target=\"_blank\">https://www.kaggle.com/trushk/a-pytorch-template-for-experimentation</a></p>\n<p>Feedback/comments welcome! </p>",
      "rawMarkdown": "I put together a Pytorch based template that users could use for experimentation, training and inference which was not specific to any competition. \n\nAfter defining the specific dataset related options, a user can then experiment with the following features:\n\n- Get list of models via --find_model eg. --find_model se*resnet*50\n\n- Testing a sample of data via --n_samples to make sure main code works fine for changes\n\n- Testing augmentation visually via --test_loader and changing the augments in the get_sample_transforms function. I noticed that a lot of people dont really look at the details of the augmentations and this helps quickly look at what they are really doing\n\n- Providing a scheduler or loss function via --scheduler <scheduler name> / --loss_fn <loss function name> \n\n- Optionally get noisy labels using CleanLab (https://github.com/cgnorthcutt/cleanlab)\n\n- Save best model for each epoch and each fold\n\n- Support for upsampling/downsampling\n\n- Optional Cutmix (per batch with 25% probability)\n\n- Optional SVM head on CNN model\n\n**The script saves all states for reproducibility in the future - eg. List. ofcommand line arguments, list of config options, augmentations performed, scores etc**\n\n**Notebook:**\nhttps://www.kaggle.com/trushk/a-pytorch-template-for-experimentation\n\nFeedback/comments welcome!",
      "votes": null
    },
    {
      "id": "1334697",
      "postDate": "06/03/2021 17:38:19",
      "content": "<p>Good Job!</p>\n<p>Also have a look at this <a href=\"https://www.kaggle.com/mahnoorshahidshakir/beginner-level-introduction-to-tensors-pytorch\" target=\"_blank\">https://www.kaggle.com/mahnoorshahidshakir/beginner-level-introduction-to-tensors-pytorch</a></p>\n<p>A good guide to basic understanding of tensors and its operations to get a kick-start in pytorch. Very Useful! </p>",
      "rawMarkdown": "Good Job!\n\nAlso have a look at this https://www.kaggle.com/mahnoorshahidshakir/beginner-level-introduction-to-tensors-pytorch\n\nA good guide to basic understanding of tensors and its operations to get a kick-start in pytorch. Very Useful!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1334697,
      "author_name": "rabiashehzad5511",
      "author_url": "",
      "post_date": "06/03/2021 17:38:19",
      "content": "<p>Good Job!</p>\n<p>Also have a look at this <a href=\"https://www.kaggle.com/mahnoorshahidshakir/beginner-level-introduction-to-tensors-pytorch\" target=\"_blank\">https://www.kaggle.com/mahnoorshahidshakir/beginner-level-introduction-to-tensors-pytorch</a></p>\n<p>A good guide to basic understanding of tensors and its operations to get a kick-start in pytorch. Very Useful! </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1193922": "I put together a Pytorch based template that users could use for experimentation, training and inference which was not specific to any competition. \n\nAfter defining the specific dataset related options, a user can then experiment with the following features:\n\n- Get list of models via --find_model eg. --find_model se*resnet*50\n\n- Testing a sample of data via --n_samples to make sure main code works fine for changes\n\n- Testing augmentation visually via --test_loader and changing the augments in the get_sample_transforms function. I noticed that a lot of people dont really look at the details of the augmentations and this helps quickly look at what they are really doing\n\n- Providing a scheduler or loss function via --scheduler <scheduler name> / --loss_fn <loss function name> \n\n- Optionally get noisy labels using CleanLab (https://github.com/cgnorthcutt/cleanlab)\n\n- Save best model for each epoch and each fold\n\n- Support for upsampling/downsampling\n\n- Optional Cutmix (per batch with 25% probability)\n\n- Optional SVM head on CNN model\n\n**The script saves all states for reproducibility in the future - eg. List. ofcommand line arguments, list of config options, augmentations performed, scores etc**\n\n**Notebook:**\nhttps://www.kaggle.com/trushk/a-pytorch-template-for-experimentation\n\nFeedback/comments welcome!",
    "1334697": "Good Job!\n\nAlso have a look at this https://www.kaggle.com/mahnoorshahidshakir/beginner-level-introduction-to-tensors-pytorch\n\nA good guide to basic understanding of tensors and its operations to get a kick-start in pytorch. Very Useful!"
  },
  "source": "meta"
}