Metadata-Version: 2.1
Name: slg-nimrod
Version: 0.0.11
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.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torchtext
Requires-Dist: torchvision
Requires-Dist: torchaudio
Requires-Dist: torchdata
Requires-Dist: jupyterlab
Requires-Dist: nbdev
Requires-Dist: numpy
Requires-Dist: lightning
Requires-Dist: anyascii
Requires-Dist: datasets
Requires-Dist: encodec
Requires-Dist: fairscale
Requires-Dist: hydra_colorlog
Requires-Dist: hydra-core
Requires-Dist: hydra-optuna-sweeper
Requires-Dist: inflect
Requires-Dist: ipykernel
Requires-Dist: jupyterlab
Requires-Dist: jupyterlab-quarto
Requires-Dist: librosa
Requires-Dist: lhotse
Requires-Dist: matplotlib
Requires-Dist: nvitop
Requires-Dist: omegaconf
Requires-Dist: onnxruntime
Requires-Dist: optuna
Requires-Dist: pandas
Requires-Dist: phonemizer
Requires-Dist: plum-dispatch
Requires-Dist: portalocker
Requires-Dist: pre-commit
Requires-Dist: python-dotenv
Requires-Dist: pytest
Requires-Dist: spacy==3.6
Requires-Dist: streamlit
Requires-Dist: timm
Requires-Dist: tensorboard
Requires-Dist: tqdm
Requires-Dist: transformers
Requires-Dist: wandb
Provides-Extra: dev

# Nimrod

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

[![python](https://img.shields.io/badge/-Python_3.7_%7C_3.8_%7C_3.9_%7C_3.10-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pytorch](https://img.shields.io/badge/PyTorch_1.10+-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

you need python \<3.12

### Install using Pip

Install package:
``` sh
pip install slg-nimrod
```
Install espeak for LM:
```bash
brew install espeak #macos
```
Install Spacy english model
```bash
python -m spacy download en_core_web_sm
```


## Usage

Download test data on which to run example recipes:

```bash
# if not already installed on your system
git lfs install 
# update changes
git lfs fetch --all
# copy the actual data
git lfs checkout
# or just
git lfs pull # combing both steps above into one (like usual git pull)
```

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

``` bash
git clone https://github.com/slegroux/nimrod.git
cd nimrod/recipes/images/mnist
python train.py datamodule.num_workers=8 trainer.max_epochs=20 trainer.accelerator='mps' loggers='tensorboard'
head conf/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 container
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
cd nimrod/recipes/images/mnist
python train.py --multirun model.n_h=16,64,256 loggers='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>
