TorchWrapper
A wrapper class for a PyTorhc Model using fit and predict functions that are familiar to those who use Keras and Sklearn.
Reduces the need to write fit and evaluation functions for basic models.
Quick Start
# import the module
from torchwrapper import Wrapper
# create your module, optimizer, and criterion function
model = Model()
optimizer = torch.optim.Adam(model.parameters())
criterion = torch.nn.MSELos()
# wrap the model
model = Wrapper(model)
# train the network
model.fit(dataloader, optimizer, criterion, epochs=50)
With a trained model, you can predict using a PyTorch dataloader:
preds = model.predict(dataloader)
This will return a numpy array of the predictions.
Metadata
Release files for torchwrapper 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torchwrapper-0.1.4.tar.gz | 2.6 kB | Details |
Release files / torchwrapper-0.1.4.tar.gz
| Download URL | torchwrapper-0.1.4.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5da3399eb7eac3c1873ed47d096e15ef89d732a16f4bbf43c1967e03e6318392
|
|
BLAKE2b-256 checksum How to use checksums |
ca1360635cd719ef59972b10657c642b99b8b01d94adb6106f94e9e0f282826f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
|