Skip to main content

MLVISION

A pytorch train library

Introduction

Most classification tasks do not require to rewrite a train loop in pytorch, using this library allows for fast iteration using any deep learning architecture.

The library can be use for cpu, gpu, and multi gpu training, and implements an efficient train loop as well as logging in order to plot train history.

Installation

You can install it using poetry by running:

poetry install

Usage

Train a Model

To train a model you will need to edit a config file with at least the path of the training and validation data.

For more details on the config you can take a look at the next section.

You can now run the train command using:

# One GPU
poetry run python train.py --config /path/to/config --devices cuda:0

The code support multi gpu training using DDP:

poetry run python train.py --config /path/to/config --devices cuda:0 cuda:1 cuda:2 ...

or cpu training:

poetry run python train.py --config /path/to/config --devices cpu

Config

The config allows you to change multiple hyper parameter of the training:

  • data
    • path to dataset
    • data augmentation
    • workers for data loaders
  • optimization
    • number of epochs
    • learning rate
    • float16 / float32
  • model
    • Architecture (defined in mlvision.models.__init__.py)
    • args: given as kwargs to the model class

Add a new model

You can easily define a new model and use it, to do so create a new file in mlvision/models and add the class in the mlvision.models.__init__.py file.

You should now be able to use it in a config file.

Release files for mlvision 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlvision 0.1.0
File Size Uploaded
mlvision-0.1.0.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlvision 0.1.0
File Interpreter ABI Platform
mlvision-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / mlvision-0.1.0.tar.gz

Download URL mlvision-0.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
94ee7ca2c4d8e43b73b99b8287c78bed6fc3ff44931156542234a8dccfe99121
BLAKE2b-256 checksum
How to use checksums
d4176e96ee328d813f8fb7b4178cd239d418333cb9d76abb224f20ec79f28dd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release files / mlvision-0.1.0-py3-none-any.whl

Download URL mlvision-0.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caa189c49b3f1304cf1dc244776568f6286d1c7e99103a39078fc0b8b98b4e54
BLAKE2b-256 checksum
How to use checksums
d0f8f68aeaa2ad9fea0d53a2070eaf5b497db4fd25122ed13491cdcffba2b770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.0-1041-azure

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page