{
  "id": 206935,
  "title": "Reusable PyTorch Pipeline",
  "url": "/competitions/cassava-leaf-disease-classification/discussion/206935",
  "author_name": "",
  "post_date": "2020-12-27T09:52:47.315267300Z",
  "votes": 14,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I have published a pipeline on training using PyTorch. If anyone finds any improvement, please comment in the notebook! I have spent a lot of time to construct such a pipeline for image classification tasks, this is because I am a strong believer in code reusability. The purpose is to change a minimal amount of code every time you run a new training. Neat and clean brings one a long way as ML/DL is more than just knowing the theories, but also includes software engineering.</p>\n<p>Much thanks to <a href=\"https://www.kaggle.com/shonenkov\" target=\"_blank\">@shonenkov</a> as my <code>Trainer Class</code> is largely modified from his previous works! Also, thanks to the first Quadruple GM <a href=\"https://www.kaggle.com/abhishek\" target=\"_blank\">@abhishek</a> as his <a href=\"https://www.youtube.com/user/abhisheksvnit\" target=\"_blank\">youtube videos</a> inspired me to (try my best to) write clean code.</p>\n<p>PS: It does not look as neat in notebook format, but I made a GitHub link to store individual classes into respective files, which is a better practice. I will also further attach my detailed explanation of each line when I have the time.</p>\n<p>Further Edits: I used this Pipeline for almost all my training. <br>\nBest single model (5 folds) - effnetb5-ns - CV: 0.891, LB: 0.898 No TTA</p>\n<p><a href=\"https://www.kaggle.com/reighns/super-complete-and-reusable-pytorch-pipeline\" target=\"_blank\">Reusable PyTorch Pipeline</a></p>",
  "messages": [
    {
      "id": "1128290",
      "postDate": "12/27/2020 09:52:47",
      "content": "<p>I have published a pipeline on training using PyTorch. If anyone finds any improvement, please comment in the notebook! I have spent a lot of time to construct such a pipeline for image classification tasks, this is because I am a strong believer in code reusability. The purpose is to change a minimal amount of code every time you run a new training. Neat and clean brings one a long way as ML/DL is more than just knowing the theories, but also includes software engineering.</p>\n<p>Much thanks to <a href=\"https://www.kaggle.com/shonenkov\" target=\"_blank\">@shonenkov</a> as my <code>Trainer Class</code> is largely modified from his previous works! Also, thanks to the first Quadruple GM <a href=\"https://www.kaggle.com/abhishek\" target=\"_blank\">@abhishek</a> as his <a href=\"https://www.youtube.com/user/abhisheksvnit\" target=\"_blank\">youtube videos</a> inspired me to (try my best to) write clean code.</p>\n<p>PS: It does not look as neat in notebook format, but I made a GitHub link to store individual classes into respective files, which is a better practice. I will also further attach my detailed explanation of each line when I have the time.</p>\n<p>Further Edits: I used this Pipeline for almost all my training. <br>\nBest single model (5 folds) - effnetb5-ns - CV: 0.891, LB: 0.898 No TTA</p>\n<p><a href=\"https://www.kaggle.com/reighns/super-complete-and-reusable-pytorch-pipeline\" target=\"_blank\">Reusable PyTorch Pipeline</a></p>",
      "rawMarkdown": "I have published a pipeline on training using PyTorch. If anyone finds any improvement, please comment in the notebook! I have spent a lot of time to construct such a pipeline for image classification tasks, this is because I am a strong believer in code reusability. The purpose is to change a minimal amount of code every time you run a new training. Neat and clean brings one a long way as ML/DL is more than just knowing the theories, but also includes software engineering.\n\nMuch thanks to @shonenkov as my `Trainer Class` is largely modified from his previous works! Also, thanks to the first Quadruple GM @abhishek as his [youtube videos](https://www.youtube.com/user/abhisheksvnit) inspired me to (try my best to) write clean code.\n\nPS: It does not look as neat in notebook format, but I made a GitHub link to store individual classes into respective files, which is a better practice. I will also further attach my detailed explanation of each line when I have the time.\n\nFurther Edits: I used this Pipeline for almost all my training. \nBest single model (5 folds) - effnetb5-ns - CV: 0.891, LB: 0.898 No TTA\n\n[Reusable PyTorch Pipeline](https://www.kaggle.com/reighns/super-complete-and-reusable-pytorch-pipeline)",
      "votes": null
    },
    {
      "id": "1128633",
      "postDate": "12/27/2020 15:57:10",
      "content": "<p>Great notebook！Thanks for sharing.</p>\n<p>BTW, how do you feel about the size of models. <br>\nIt there much difference from b3-b5 for you?<br>\nNot that much for me.</p>",
      "rawMarkdown": "Great notebook！Thanks for sharing.\n\nBTW, how do you feel about the size of models. \nIt there much difference from b3-b5 for you?\nNot that much for me.",
      "votes": null
    },
    {
      "id": "1128642",
      "postDate": "12/27/2020 16:11:13",
      "content": "<p>It wasn't that different for me.</p>\n<p>p.s. there may still be insufficient experiments.<br>\n<a href=\"https://www.kaggle.com/zlanan\" target=\"_blank\">@zlanan</a> </p>",
      "rawMarkdown": "It wasn't that different for me.\n\np.s. there may still be insufficient experiments.\n@zlanan",
      "votes": null
    },
    {
      "id": "1128651",
      "postDate": "12/27/2020 16:24:33",
      "content": "<p><a href=\"https://www.kaggle.com/zlanan\" target=\"_blank\">@zlanan</a> hey not much difference for me. I only used effnets so far but b5ns with a certain aug seems to score very well on LB. even without tta</p>",
      "rawMarkdown": "zlanan hey not much difference for me. I only used effnets so far but b5ns with a certain aug seems to score very well on LB. even without tta",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1128633,
      "author_name": "zlanan",
      "author_url": "",
      "post_date": "12/27/2020 15:57:10",
      "content": "<p>Great notebook！Thanks for sharing.</p>\n<p>BTW, how do you feel about the size of models. <br>\nIt there much difference from b3-b5 for you?<br>\nNot that much for me.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1128642,
          "author_name": "piantic",
          "author_url": "",
          "post_date": "12/27/2020 16:11:13",
          "content": "<p>It wasn't that different for me.</p>\n<p>p.s. there may still be insufficient experiments.<br>\n<a href=\"https://www.kaggle.com/zlanan\" target=\"_blank\">@zlanan</a> </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1128651,
          "author_name": "reighns",
          "author_url": "",
          "post_date": "12/27/2020 16:24:33",
          "content": "<p><a href=\"https://www.kaggle.com/zlanan\" target=\"_blank\">@zlanan</a> hey not much difference for me. I only used effnets so far but b5ns with a certain aug seems to score very well on LB. even without tta</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1128290": "I have published a pipeline on training using PyTorch. If anyone finds any improvement, please comment in the notebook! I have spent a lot of time to construct such a pipeline for image classification tasks, this is because I am a strong believer in code reusability. The purpose is to change a minimal amount of code every time you run a new training. Neat and clean brings one a long way as ML/DL is more than just knowing the theories, but also includes software engineering.\n\nMuch thanks to @shonenkov as my `Trainer Class` is largely modified from his previous works! Also, thanks to the first Quadruple GM @abhishek as his [youtube videos](https://www.youtube.com/user/abhisheksvnit) inspired me to (try my best to) write clean code.\n\nPS: It does not look as neat in notebook format, but I made a GitHub link to store individual classes into respective files, which is a better practice. I will also further attach my detailed explanation of each line when I have the time.\n\nFurther Edits: I used this Pipeline for almost all my training. \nBest single model (5 folds) - effnetb5-ns - CV: 0.891, LB: 0.898 No TTA\n\n[Reusable PyTorch Pipeline](https://www.kaggle.com/reighns/super-complete-and-reusable-pytorch-pipeline)",
    "1128633": "Great notebook！Thanks for sharing.\n\nBTW, how do you feel about the size of models. \nIt there much difference from b3-b5 for you?\nNot that much for me.",
    "1128642": "It wasn't that different for me.\n\np.s. there may still be insufficient experiments.\n@zlanan",
    "1128651": "zlanan hey not much difference for me. I only used effnets so far but b5ns with a certain aug seems to score very well on LB. even without tta"
  },
  "source": "meta"
}