Skip to main content

A python module and experiment manager for deep learning

Project description

Matรฉ ๐Ÿง‰ your friendly AI project and experiment manager

Matรฉ is a python project, package and experiment manager. Whether you are a seasoned deep learning researcher or just starting out, Matรฉ provides you with the tools to easily add source code and dependencies of models, trainers, and data loaders to your projects. With Matรฉ, you can also evaluate, train, and keep track of your experiments with ease ๐Ÿš€

Features ๐ŸŽ‰

  • Seamless integration with popular deep learning libraries such as PyTorch, TensorFlow, and JAX.
  • Easy to use interface to add source code of models, trainers, and data loaders to your projects.
  • Support for full customizability and reproducibility of results through the inclusion of source code dependencies in your project.
  • Modular project structure that enforces a clean and organized codebase.
  • Convenient environment management through the Matรฉ Environment API.
  • Support for pip and conda for dependency management.
  • Works with Colab.

Table of Contents

Installation ๐Ÿ”Œ

pip install yerbamate

Quick Start โšก

Initialize a project

mate init deepnet

This will generate the following empty project structure:

/
|-- models/
|   |-- __init__.py
|-- experiments/
|   |-- __init__.py
|-- trainers/
|   |-- __init__.py
|-- data/
|   |-- __init__.py

Install an experiment

To install an experiment, you can use mate install to install a module and its dependencies from a github repository. See docs for more details.

# Short version of GitHub URL https://github.com/oalee/big_transfer/tree/master/big_transfer/experiments/bit
mate install oalee/big_transfer/experiments/bit -yo pip

# Short version of GitHub URL https://github.com/oalee/deep-vision/tree/main/deepnet/experiments/resnet
mate install oalee/deep-vision/deepnet/experiments/resnet -yo pip

Install a module

You can install independant modules such as models, trainers, and data loaders from github projects that follow the Independent modular project structure.

mate install oalee/lightweight-gan/lgan/trainers/lgan 
mate install oalee/big_transfer/models/bit -yo pip
mate install oalee/deep-vision/deepnet/models/vit_pytorch -yo pip
mate install oalee/deep-vision/deepnet/trainers/classification -yo pip

Setting up environment

Take a look at Environment API and set up your environment before running your experiments.

Train a model

To train a model, you can use the mate train command. This command will train the model with the specified experiment. For example, to train the an experiment called learn in the bit module, you can use the following command:

mate train bit learn
# or alternatively use python
python -m train deepnet.experiments.bit.learn

Project Structure ๐Ÿ“

Deep learning projects can be organized into the following structure with modularity and seperation of concerns in mind. This offers a clean and organized codebase that is easy to maintain and is sharable out-of-the-box.

/
|-- models/
|   |-- __init__.py
|-- experiments/
|   |-- __init__.py
|-- trainers/
|   |-- __init__.py
|-- data/
|   |-- __init__.py

Modularity

Modularity is a software design principle that focuses on creating self-contained, reusable and interchangeable components. In the context of a deep learning project, modularity means creating three independent standalone modules for models, trainers and data. This allows for a more organized, maintainable and sharable project structure. The forth module, experiments, is not independent, but rather combines the three modules together to create a complete experiment.

Sample Modular Project Structure

This structure highlights modularity and seperation of concerns. The models, data and trainers modules are independent and can be used in any project. The experiments module is not independent, but rather combines the three modules together to create a complete experiment.

.
โ”œโ”€โ”€ mate.json
โ””โ”€โ”€ deepnet
    โ”œโ”€โ”€ data
    โ”‚   โ”œโ”€โ”€ bit
    โ”‚   โ”‚   โ”œโ”€โ”€ fewshot.py
    โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”‚   โ”œโ”€โ”€ minibatch_fewshot.py
    โ”‚   โ”‚   โ”œโ”€โ”€ requirements.txt
    โ”‚   โ”‚   โ””โ”€โ”€ transforms.py
    โ”‚   โ””โ”€โ”€ __init__.py
    โ”œโ”€โ”€ experiments
    โ”‚   โ”œโ”€โ”€ bit
    โ”‚   โ”‚   โ”œโ”€โ”€ aug.py
    โ”‚   โ”‚   โ”œโ”€โ”€ dependencies.json
    โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”‚   โ”œโ”€โ”€ learn.py
    โ”‚   โ”‚   โ””โ”€โ”€ requirements.txt
    โ”‚   โ””โ”€โ”€ __init__.py
    โ”œโ”€โ”€ __init__.py
    โ”œโ”€โ”€ models
    โ”‚   โ”œโ”€โ”€ bit_torch
    โ”‚   โ”‚   โ”œโ”€โ”€ downloader
    โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ downloader.py
    โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ requirements.txt
    โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ utils.py
    โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”‚   โ”œโ”€โ”€ models.py
    โ”‚   โ”‚   โ””โ”€โ”€ requirements.txt
    โ”‚   โ””โ”€โ”€ __init__.py
    โ””โ”€โ”€ trainers
        โ”œโ”€โ”€ bit_torch
        โ”‚   โ”œโ”€โ”€ __init__.py
        โ”‚   โ”œโ”€โ”€ lbtoolbox.py
        โ”‚   โ”œโ”€โ”€ logger.py
        โ”‚   โ”œโ”€โ”€ lr_schduler.py
        โ”‚   โ”œโ”€โ”€ requirements.txt
        โ”‚   โ””โ”€โ”€ trainer.py
        โ””โ”€โ”€ __init__.py

Example Projects ๐Ÿ“š

Please check out the transfer learning, vision models, and lightweight gan.

Documentation ๐Ÿ“š

Please check out the documentation.

Guides ๐Ÿ“–

For more information on modularity, please check out this guide.

Contribution ๐Ÿค

We welcome contributions from the community! Please check out our contributing guide for more information on how to get started.

Contact ๐Ÿค

For questions please contact:

yerba.mate.dl(at)proton.me

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yerbamate-0.9.20.tar.gz (74.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page