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. Also provides several architecture implementations.

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()"]
        I["<b>Provided Architectures</b><br/>(Classifier, AE, VAE, ...)"]

    end

    %% Define node relationships
    A --> C
    B --> C
    I --> A
    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

Furthermore, this package provides architecture implementations and modelling utilities. Currently implemented architectures include:

Lastly the Tuner class provides hyperparameter tuning using grid, random and random dynamic search.

For an initial guide, see the examples/mnist/classifier/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.3.0.tar.gz (9.8 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.3.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for my_pytorch_kit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e899b4fd4d74b1c318f2b6df93802f0357af3af2d0332a1814ce75b54cdac84b
MD5 b3daf28d0010fd99634c569669242f33
BLAKE2b-256 08da7e83cbb8874922ddedbecaffc18c5633d53c941b0c35023eb608189d03a2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for my_pytorch_kit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9641a6371d59496e5b8388d01b3267e77ee844fd71916b09a32639cc4b50f6f7
MD5 f4c8fc5d7b3a6b6da79afcedefb35d6f
BLAKE2b-256 940f4663851a821dd1ecf3b4efe8bc83a934df5b6e172db7d2372385bd90de41

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