ai_repoΒΆ

format-lint on-push-with-image code style: black

ExamplesΒΆ

πŸ”’ MNIST classification with a MLP

python projects/classify_mnist/train.py task=mlp

🀸 Acrobot score optimization with neuroevolution

python -m projects.ne_control_score task=acrobot

Table of ContentsΒΆ

πŸ‘€ I. Introduction

πŸ“– II. Overview

🌳 III. Rough repository tree

I. IntroductionΒΆ

This repo aims to:

Reduce code & configuration boilerplate with:

Simplify machine learning workflows:

  • Hyperparameter optimization with AutoRL-Sweepers & Optuna.

  • SLURM job definition, queuing and monitoring with Submitit through its Hydra Launcher plugin.

  • Docker / Apptainer environment containerization for both regular & SLURM-based execution.

  • Transition from regular execution to SLURM-based execution by only swapping container technology and as little as a single Hydra configuration field.

Automate workspace & coding processes:

  • Package upgrades through Renovate.

  • Docstring documentation generation with Sphinx.

  • Pre-commit formatting & linting hooks with pre-commit.

  • Documentation/Docker image validation/deployment, formatting, linting, type-checking & unit tests upon contribution to the main branch using GitHub Actions.

Facilitate collaboration through:

Promote high-quality and reproducible code by:

Smoothen up rough edges by providing:

  • Extensive documentation on how to install/execute on regular & SLURM-based systems.

  • Unassuming guides on how to contribute to the codebase.

  • Tutorials on how to facilitate code transport across machines.

II. OverviewΒΆ

ServiceΒΆ

πŸ” OverviewΒΆ

A service refers to a Python package located at common/SERVICE_NAME/. Each service is meant to sketch out a form of execution.

πŸ“‚ ExamplesΒΆ

EngineΒΆ

πŸ” OverviewΒΆ

An engine refers to a Python package located at common/SERVICE_NAME/ENGINE_NAME. Each engine is meant to drive a specific type of execution.

πŸ“‚ ExamplesΒΆ

ProjectΒΆ

πŸ” OverviewΒΆ

A project refers to a Python package located at projects/PROJECT_NAME/.

πŸ“‚ ExamplesΒΆ

TaskΒΆ

πŸ” OverviewΒΆ

A task is a work unit specified by a Hydra .yaml config file located in projects/PROJECT_NAME/task/TASK_NAME.yaml.

πŸ“‚ ExamplesΒΆ

SubtaskΒΆ

A subtask is a sub-work unit of a task (ex: a model training run with a specific set of hyper-parameters).

Rough repository treeΒΆ

ai_repo/
β”œβ”€ .github/                  <-- Config files for GitHub Actions (tests, containers, etc)
β”œβ”€ common/                   <-- Code common to various `projects`
β”‚  β”œβ”€ infer/                 <-- Model inference
β”‚  β”‚  └─ lightning/          <-- Inference from Lightning checkpoints
β”‚  └─ optim/                 <-- Model optimization
β”‚     β”œβ”€ dl/                 <-- Deep Learning
β”‚     β”‚  β”œβ”€ datamodule/      <-- Lightning DataModules
β”‚     β”‚  β”œβ”€ litmodule/       <-- Lightning Modules
β”‚     β”‚  β”‚  └─ nnmodule/     <-- PyTorch Modules
β”‚     β”‚  └─ train.py
β”‚     └─ ne/                 <-- Neuroevolution
β”‚        β”œβ”€ agent/
β”‚        β”œβ”€ net/
β”‚        β”œβ”€ space/           <-- Where agents evolve
β”‚        └─ evolve.py
β”œβ”€ docs/                     <-- Documentation
└─ projects/                 <-- Contains all existing projects
   β”‚
   β”‚                             ******************************************
   └─ my_new_dl_project/     <-- ******** Your new project folder *********
      β”œβ”€ task/               <-- *********** Your task folder *************
      β”‚  └─ config.yaml      <-- ****** Your task configuration file ******
      β”œβ”€ __main__.py         <-- ************ Your entry-point ************
      β”œβ”€ datamodule.py       <-- ******* Your Lightning DataModule ********
      β”œβ”€ litmodule.py        <-- ********* Your Lightning Module **********
      └─ nnmodule.py         <-- ********** Your PyTorch Module ***********
                                 ******************************************

ContentsΒΆ

common

Contains functionality common to multiple projects.

projects

Projects repository.