Metadata-Version: 2.4
Name: my_pytorch_kit
Version: 0.2.0
Summary: My toolkit for pytorch model development
Author-email: Noah Schlenker <noschl@proton.me>
License: MIT License
        
        Copyright (c) 2025 Noah Schlenker
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/noahpy/my_pytorch_kit
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: torch
Requires-Dist: tqdm
Requires-Dist: tensorboard
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

![Testing workflow](https://github.com/noahpy/pytorch_toolkit/actions/workflows/ci.yaml/badge.svg)

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

## Installation
### From PyPI

```bash
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.  
```mermaid
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.  

