-
Hi there, thanks for the amazing work before posting any feature request, I wanted to open a discussion, because I may be just missing stuff. I was wondering:
best |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@aliutkus that's a good question and I should have a guide for that, right now, the only guide is the existing models and the unit tests, the unit tests cover the core model API so if you created a model in timm and it's implemented correctly, it'll get picked up by the unit tests and pass. The models are fairly standard PyTorch models (not much different from torchvision) with some extras and some uniformity for certain args. To add a model in timm you need:
For init args, all models should have these present: Also common for many (but not all) are Models that have customizable activations and norm layers usually have Model should implement common functionality to create the model or reset/get the classifier head after creation. Most of my though re interface was when all models were convnets, now that a lot are vision transformers or mlp models, there are two classes of models. I currently have some work underway to make the vit-like models a bit closer to the CNN on a few of the API details around classifier / pooling / feature extraction. There are a bunch of non-obvious details re setting up the feature extraction interface correctly, that's non-trivial to describe.... |
Beta Was this translation helpful? Give feedback.
-
Thanks for the very detailed and great answers. I mark this as an answer, but continue the discussion I must admit that it was indeed ok to start writing my own model rapidly: the overhead due to the framework is minimal. I managed to do that quite easily. The daunting part precisely is about the factory: model creation, parameters handling, the As a suggestion, it could be great to have some Also, this would make it easier for anyone to propose PR to augment timm with his own model ! thanks again for the great work and the time you took to answer my question |
Beta Was this translation helpful? Give feedback.
@aliutkus that's a good question and I should have a guide for that, right now, the only guide is the existing models and the unit tests, the unit tests cover the core model API so if you created a model in timm and it's implemented correctly, it'll get picked up by the unit tests and pass.
The models are fairly standard PyTorch models (not much different from torchvision) with some extras and some uniformity for certain args.
To add a model in timm you need:
nn.Module
(ieResNet
) and implements the architectureresnet50
) that instantiates the class w/ args for a variant of that archite…