Skip to main content

`Keras.Model.fit`-like torch fit implementation

Project description

torch-model

Keras-like torch module wrapper

Tested with Torch 1.8.0

Install

$ pip install torch-model

Usage

from torch_model import Model
from torch_model.callbacks import EarlyStopping

model = Model(MyPyTorchModule())

model.compile(
    loss='mse',
    optimizer='adam',
    metrics=['mae', 'mape']
)

history = model.fit(
    train_ds,
    validation_data=val_ds,
    callbacks=[
        EarlyStopping(monitor='val_loss', patience=5)
    ]
)

# The original torch module
model.module

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch-model-0.0.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

torch_model-0.0.1-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page