Skip to main content

Speech, Language and Multimodal Processing models and utilities in PyTorch

Project description

slp

Python Version

slp is a framework for fast and reproducible development of multimodal models, with emphasis on NLP models.

It started as a collection of scripts and code I wrote / collected during my PhD and it evolves accordingly.

As such, the framework is opinionated and it follows a convention over configuration approach.

A heavy emphasis is put on:

  • Enforcing best practices and reproducibility of experiments
  • Making common things fast at the top-level and not having to go through extensive configuration options
  • Remaining extendable. Extensions and modules for more use cases should be easy to add
  • Out of the box extensive logging and experiment management
  • Separating dirty / scratch code (at the script level) for quick changes and clean / polished code at the library level

This is currently in alpha release under active development, so things may break and new features will be added.

Dependencies

We use Pytorch (1.7) and the following libraries

Installation

You can use slp as an external library by installing from PyPI with

pip install slp

Or you can clone it from github

git clone git@github.com:georgepar/slp

We use poetry for dependency management

When you clone the repo run:

pip install poetry
poetry install

and a clean environment with all the dependencies will be created. You can access it with poetry shell.

Note: Wandb logging is enabled by default. You can either

  • Create an account and run wandb login when you clone the repo in a new machine to store the results in the online managed environment
  • Run wandb offline when you clone the repo to disable remote sync or use the --offline command line argument in your scripts
  • Use one of their self-hosted solutions

Create a new project based on slp

You can use the template at https://github.com/georgepar/cookiecutter-pytorch-slp to create a new project based on slp

pip install cookiecutter poetry
cookiecutter gh:georgepar/cookiecutter-pytorch-slp
# Follow the interactive configuration and a new folder with the project name you provided will appear
cd $PROJECT_NAME
poetry install  # Installs slp and all other dependencies

And you are good to go. Follow the instructions in the README of the new project you created. Happy coding

Contributing

You are welcome to open issues / PRs with improvements and bug fixes.

Since this is mostly a personal project based around workflows and practices that work for me, I don't guarantee I will accept every change, but I'm always open to discussion.

If you are going to contribute, please use the pre-commit hooks under hooks, otherwise the PR will not go through the CI. And never, ever touch requirements.txt by hand, it will automatically be exported from poetry

cat <<EOT >> .git/hooks/pre-commit
#!/usr/bin/env bash

bash hooks/export-requirements-txt
bash hooks/checks
EOT

chmod +x .git/hooks/pre-commit  # Keep an up-to-date requirements.txt and run Linting, typechecking and tests

ln -s $(pwd)/hooks/commit-msg .git/hooks/commit-msg  # Sign-off your commit

Cite

If you use this code for your research, please include the following citation

@ONLINE {,
    author = "Georgios Paraskevopoulos",
    title  = "slp",
    year   = "2020",
    url    = "https://github.com/georgepar/slp"
}

Roadmap

  • Optuna integration for hyperparameter tuning
  • Add dataloaders for popular multimodal datasets
  • Add multimodal architectures
  • Add RIM, DNC and Kanerva machine implementations
  • Write unit tests

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

slp-1.1.5.tar.gz (66.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slp-1.1.5-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

File details

Details for the file slp-1.1.5.tar.gz.

File metadata

  • Download URL: slp-1.1.5.tar.gz
  • Upload date:
  • Size: 66.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.3 Linux/5.4.72-microsoft-standard-WSL2

File hashes

Hashes for slp-1.1.5.tar.gz
Algorithm Hash digest
SHA256 eb4e82d17d4d7092302bef5f7d3c035b6cfa21b963a3a52b97e02d3a43d24692
MD5 f70171a3fa1f8307337b2264d8adef7d
BLAKE2b-256 dccc7b28d8820e6d019b65323db799d42981d5c1ebcb47592a9ab9154de00dee

See more details on using hashes here.

File details

Details for the file slp-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: slp-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.3 Linux/5.4.72-microsoft-standard-WSL2

File hashes

Hashes for slp-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2be5f50fb09e7f73d8ac7b4ecefba070a929d38db78855660d5f74ba66971e
MD5 214c37b27754d4c3d6be25e14d30f200
BLAKE2b-256 36057828639b282c29aea7cc434d2549b9e35288d5af1e768b2f0e1cfe3ee06f

See more details on using hashes here.

Supported by

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