superduper_torch
Superduper allows users to work with arbitrary torch
models, with custom pre-, post-processing and input/ output data-types, as well as offering training with superduper
Installation​
pip install superduper_torch
API​
Class | Description |
---|---|
superduper_torch.model.TorchModel | Torch model. This class is a wrapper around a PyTorch model. |
superduper_torch.training.TorchTrainer | Configuration for the PyTorch trainer. |
Examples​
TorchModel​
import torch
from superduper_torch.model import TorchModel
model = TorchModel(
object=torch.nn.Linear(32, 1),
identifier="test",
preferred_devices=("cpu",),
postprocess=lambda x: int(torch.sigmoid(x).item() > 0.5),
)
model.predict(torch.randn(32))
Training Example​
Read more about this here