Skip to main content

My toolkit for pytorch model development

Project description

Testing workflow

My Pytorch Toolkit

Userful pytorch toolkit for training models, replacing boilerplate code. Provides functions for training, modeling and evaluating models.

Installation

From PyPI

pip install my-pytorch-kit

From source

Clone this repo and run pip install ..
Then, you can import the module my_pytorch_kit.

Usage

This package revolves around the BaseModel, Trainer and Evaluator classes, which are extended to model, train and evaluate a model respectively.

graph TD
    subgraph "Usage Workflow"
        A["<b>Define Model</b><br/>(extends BaseModel)"]
        B["<b>Define Data</b><br/>(Dataset / DataLoader)"]
        G["<b>Extras</b><br/>(Optimizer, Tensorboard)"]
        C["<b>Initialize Trainer</b><br/>(extends Trainer)"]
        D["<b>Initialize Evaluator</b><br/>(extends Evaluator)"]
        E["trainer.train()"]
        F["evaluator.evaluate()"]
        G["<b>Intitialize Tuner</b><br/>(Hyperparameter Tuning)"]
        H["tuner.tune()"]
    end

    %% Define node relationships
    A --> C
    B --> C
    A --> D
    B --> D
    C --> E
    D --> F
    C --> G
    G --> H

    %% Style the nodes
    style A fill:#fbe,stroke:#333,stroke-width:2px
    style B fill:#fbe,stroke:#333,stroke-width:2px
    style G fill:#ffc,stroke:#333,stroke-width:2px
    style C fill:#cde,stroke:#333,stroke-width:2px
    style D fill:#cde,stroke:#333,stroke-width:2px
    style E fill:#cfc,stroke:#333,stroke-width:2px
    style F fill:#cfc,stroke:#333,stroke-width:2px
    style G fill:#cde,stroke:#333,stroke-width:2px
    style H fill:#cfc,stroke:#333,stroke-width:2px

For a detailed guide, see the examples/example.py file :)

Development

Clone this repo and run pip install -e .[dev].
Run pytest in the root directory to run tests.

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

my_pytorch_kit-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

my_pytorch_kit-0.2.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file my_pytorch_kit-0.2.0.tar.gz.

File metadata

  • Download URL: my_pytorch_kit-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for my_pytorch_kit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ce32a7f685851ac4f585bb43e9ce4fa1c01f9be9a9f2c6f205553a767c2ed10e
MD5 78786a829a2f0d95a2dba2bee7f7742a
BLAKE2b-256 6705a310d4e59188d81597223dfb0a0d3b4763429fc8b6f6fdcb24220cb750ba

See more details on using hashes here.

File details

Details for the file my_pytorch_kit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: my_pytorch_kit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for my_pytorch_kit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b1e8e2938b232f59e28401bb2865ed4e5d12c7bdfc2ad9f3739f2b6122d4e36
MD5 fa91472e5aa684c474e3c2886e10a92f
BLAKE2b-256 850a8082df2d5cc164015521a38c11d23c37b0f7adf87a3fdbe441bdee6f85f7

See more details on using hashes here.

Supported by

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