{
  "id": 535981,
  "title": "class Trainer for all models",
  "url": "/competitions/rsna-2024-lumbar-spine-degenerative-classification/discussion/535981",
  "author_name": "",
  "post_date": "2024-09-25T10:19:09.359144300Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>is it possible to create a class Trainer for all models (pretraned and from sctratch ) to train all model, a class </p>\n<pre><code> :\n           ():\n                     .\n                     .\n           ():\n\n\n            ()\n\n\n             ():\n</code></pre>",
  "messages": [
    {
      "id": "2998173",
      "postDate": "09/25/2024 10:19:09",
      "content": "<p>is it possible to create a class Trainer for all models (pretraned and from sctratch ) to train all model, a class </p>\n<pre><code> :\n           ():\n                     .\n                     .\n           ():\n\n\n            ()\n\n\n             ():\n</code></pre>",
      "rawMarkdown": "is it possible to create a class Trainer for all models (pretraned and from sctratch ) to train all model, a class \n``` python\n\nclass Trainer:\n          def __init__(self, dataset, model, device, loss, earlystopping, n_epochs, Kfolds,....):\n                     .\n                     .\n          def fit(self):\n          \n\n           def eval(self)\n         \n\n            def predict(self, inputs):\n          \n\n\n```",
      "votes": null
    },
    {
      "id": "2998242",
      "postDate": "09/25/2024 12:07:56",
      "content": "<p>Take a look at <code>pytorch-lightining</code> package. It has a <code>Trainer</code> class that has what you are asking for in PyTorch<br>\n<a href=\"https://lightning.ai/docs/pytorch/stable/\" target=\"_blank\">https://lightning.ai/docs/pytorch/stable/</a></p>",
      "rawMarkdown": "Take a look at `pytorch-lightining` package. It has a `Trainer` class that has what you are asking for in PyTorch\nhttps://lightning.ai/docs/pytorch/stable/",
      "votes": null
    },
    {
      "id": "2999997",
      "postDate": "09/27/2024 06:50:22",
      "content": "<p>thank you , that's what i looking for</p>",
      "rawMarkdown": "thank you , that's what i looking for",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2998242,
      "author_name": "coderrkj",
      "author_url": "",
      "post_date": "09/25/2024 12:07:56",
      "content": "<p>Take a look at <code>pytorch-lightining</code> package. It has a <code>Trainer</code> class that has what you are asking for in PyTorch<br>\n<a href=\"https://lightning.ai/docs/pytorch/stable/\" target=\"_blank\">https://lightning.ai/docs/pytorch/stable/</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 2999997,
          "author_name": "saidkoussi",
          "author_url": "",
          "post_date": "09/27/2024 06:50:22",
          "content": "<p>thank you , that's what i looking for</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2998173": "is it possible to create a class Trainer for all models (pretraned and from sctratch ) to train all model, a class \n``` python\n\nclass Trainer:\n          def __init__(self, dataset, model, device, loss, earlystopping, n_epochs, Kfolds,....):\n                     .\n                     .\n          def fit(self):\n          \n\n           def eval(self)\n         \n\n            def predict(self, inputs):\n          \n\n\n```",
    "2998242": "Take a look at `pytorch-lightining` package. It has a `Trainer` class that has what you are asking for in PyTorch\nhttps://lightning.ai/docs/pytorch/stable/",
    "2999997": "thank you , that's what i looking for"
  },
  "source": "meta"
}