[P] Fitting (almost) any PyTorch module with just one line, including easy BERT fine-tuning
My name is Dima and I wanted to tell you about an open-source library we work on called TamnunML.
Our goal is to provide an easy to use library (with
sklearn interface) for complex model training and fine-tuning. For example, with
tamnun you can train any
pytorch module like this:
“`python from torch import nn from tamnun.core import TorchEstimator
module = nn.Linear(128, 2) clf = TorchEstimator(module, task_type=’classification’).fit(train_X, train_y) “`
or, you can fine tune BERT on your task as easy as: “`python from tamnun.bert import BertClassifier, BertVectorizer from sklearn.pipeline import make_pipeline
clf = make_pipeline(BertVectorizer(), BertClassifier(num_of_classes=2)).fit(train_X, train_y) predicted = clf.predict(test_X) “`
At the moment
tamnun supports training (almost) any
pytorch module using just a “fit” method, easy BERT fine-tuning and model distillation.
You can read more about how to train (almost) any pytroch module with tamnun here
The library github page.