Metadata-Version: 2.4
Name: slg_nimrod
Version: 0.1.0
Summary: minimal deep learning framework
Home-page: https://github.com/slegroux/nimrod
Author: Sylvain Le Groux
Author-email: slegroux@ccrma.stanford.edu
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch==2.9.1
Requires-Dist: torchvision==0.24.1
Requires-Dist: torchaudio==2.9.1
Requires-Dist: numpy
Requires-Dist: lightning
Requires-Dist: torchmetrics
Requires-Dist: tensorboard
Requires-Dist: anyascii
Requires-Dist: datasets
Requires-Dist: einops
Requires-Dist: hydra-core
Requires-Dist: hydra_colorlog
Requires-Dist: inflect
Requires-Dist: matplotlib
Requires-Dist: omegaconf
Requires-Dist: pandas
Requires-Dist: phonemizer
Requires-Dist: pillow
Requires-Dist: plum-dispatch
Requires-Dist: python-dotenv
Requires-Dist: requests
Requires-Dist: rich
Requires-Dist: six
Requires-Dist: torch-lr-finder
Requires-Dist: torchinfo
Requires-Dist: tqdm
Requires-Dist: transformers<5,>=4.40
Requires-Dist: wandb
Provides-Extra: audio
Requires-Dist: lhotse; extra == "audio"
Requires-Dist: librosa; extra == "audio"
Requires-Dist: encodec; extra == "audio"
Requires-Dist: ipython; extra == "audio"
Provides-Extra: diffusion
Requires-Dist: diffusers; extra == "diffusion"
Requires-Dist: accelerate; extra == "diffusion"
Provides-Extra: image
Requires-Dist: timm; extra == "image"
Requires-Dist: fairscale; extra == "image"
Requires-Dist: ftfy; extra == "image"
Provides-Extra: tracking
Requires-Dist: hydra-optuna-sweeper; extra == "tracking"
Requires-Dist: livelossplot; extra == "tracking"
Requires-Dist: torchviz; extra == "tracking"
Requires-Dist: fastprogress; extra == "tracking"
Provides-Extra: all
Requires-Dist: accelerate; extra == "all"
Requires-Dist: diffusers; extra == "all"
Requires-Dist: encodec; extra == "all"
Requires-Dist: fairscale; extra == "all"
Requires-Dist: fastprogress; extra == "all"
Requires-Dist: ftfy; extra == "all"
Requires-Dist: hydra-optuna-sweeper; extra == "all"
Requires-Dist: ipython; extra == "all"
Requires-Dist: lhotse; extra == "all"
Requires-Dist: librosa; extra == "all"
Requires-Dist: livelossplot; extra == "all"
Requires-Dist: timm; extra == "all"
Requires-Dist: torchviz; extra == "all"
Provides-Extra: dev
Requires-Dist: jupyterlab; extra == "dev"
Requires-Dist: ipykernel; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: nbdev==2.3.13; extra == "dev"
Requires-Dist: fastcore==1.5.29; extra == "dev"
Requires-Dist: execnb==0.1.5; extra == "dev"
Requires-Dist: setuptools<81; extra == "dev"
Requires-Dist: accelerate; extra == "dev"
Requires-Dist: diffusers; extra == "dev"
Requires-Dist: encodec; extra == "dev"
Requires-Dist: fairscale; extra == "dev"
Requires-Dist: fastprogress; extra == "dev"
Requires-Dist: ftfy; extra == "dev"
Requires-Dist: hydra-optuna-sweeper; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Requires-Dist: lhotse; extra == "dev"
Requires-Dist: librosa; extra == "dev"
Requires-Dist: livelossplot; extra == "dev"
Requires-Dist: timm; extra == "dev"
Requires-Dist: torchviz; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Nimrod


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

[![python](https://img.shields.io/badge/-Python_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pytorch](https://img.shields.io/badge/PyTorch_2.9-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/)
[![hydra](https://img.shields.io/badge/Config-Hydra_1.3-89b8cd)](https://hydra.cc/)
[![pre-commit](https://img.shields.io/badge/Pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white.png)](https://github.com/pre-commit/pre-commit)

## Description

This is a repo with minimal tooling, modules, models and recipes to get
easily get started with deep learning training and experimentation with
an emphasis on speech, audio and language modeling.

## Install

Requires Python 3.10 to 3.12 (PyTorch 2.9).

### Install using Pip

``` sh
pip install slg-nimrod
```

The core install covers the models, image and text datasets and training.
Optional stacks are extras: `audio`, `diffusion`, `image`, `tracking`.
`nimrod.models.diffusion` needs the `diffusion` extra, and
`nimrod.models.ngram` needs `kenlm`, installed separately
(<https://github.com/kpu/kenlm>). Install all extras with:

``` sh
pip install "slg-nimrod[all]"
```

## Usage

Check recipes in `recipes/` folder. E.g. for a simple digit recognizer
on MNIST:

``` bash
git clone https://github.com/slegroux/nimrod.git
python train.py experiment=mnist_mlp data.num_workers=8 trainer.max_epochs=20 
head config/train.yaml
```

All the parameters of the experiment are editable and read from a .yaml
file which details:

- data and logging directory paths
- data module with data source path and batching parameters
- model architecture
- trainer with hardware acceleration and number of epochs
- callbacks for early stopping and automatic logging to Wandb

## Docker

You might want to use docker containers for reproductible development
environment or run your project in the cloud

``` bash
make docker-build
docker pull slegroux/nimrod
docker run -it --rm -p 8888:8888 slegroux/nimrod /bin/bash
```

You can also use docker-compose to define services and volumes

``` bash
cd .devcontainer
docker-compose up
docker-compose down
```

## Develop

``` bash
pip install -e .
```

## Hyperparameter tuning

to compare training results on different model parameters:

``` bash
python train.py --multirun experiment=mnist_mlp model.nnet.n_h=16,64,256 logger=tensorboard trainer.max_epochs=5
```

## Server

### st webapp

Run a simple digit recognizer webapp with GUI

``` bash
cd server
./run_st_app.sh
```

## Authors

2023 Sylvain Le Groux <sylvain.legroux@gmail.com>
