Package containing utilities for implementing RSN2/MANN
Project description
BeyondML (formerly MANN)
BeyondML is a Python package which enables creating sparse multitask artificial neural networks (MANNs) compatible with TensorFlow and PyTorch. This package contains custom layers and utilities to facilitate the training and optimization of models using the Reduction of Sub-Network Neuroplasticity (RSN2) training procedure developed by AI Squared, Inc.
Installation
This package is available through PyPi and can be installed via the following command:
pip install beyondml
To install the current version directly from GitHub without cloning, run the following command:
pip install git+https://github.com/Beyond-ML-Labs/BeyondML.git
Alternatively, you can install the package by cloning the repository from GitHub using the following commands:
# clone the repository and cd into it
git clone https://github.com/Beyond-ML-Labs/BeyondML
cd BeyondML
# install the package
pip install .
Mac M1 Users
For those with a Mac with the M1 processor, this package can be installed, but the standard version of TensorFlow is not compatible with the M1 SOC. In order to install a compatible version of TensorFlow, please install the Miniforge conda environment, which utilizes the conda-forge channel only. Once you are using Miniforge, using conda to install TensorFlow in that environment should install the correct version. After installing TensorFlow, the command pip install beyondml
will install the BeyondML package.
Contributing
For those who are interested in contributing to this project, we first thank you for your interest! Please refer to the CONTRIBUTING.md file in this repository for information about best practices for how to contribute.
Vulnerability reporting
In the event you notice a vulnerability within this project, please open a GitHub Issue detailing the vulnerability to report it. In the event you would like to keep the report private, please email mann@squared.ai.
Capabilities
To view current capabilities within the BeyondML package, we welcome you to check the BeyondML documentation.
Feature Roadmap
Lists of features slated for this project will be added here.
Changes
Below are a list of additional features, bug fixes, and other changes made for each version.
MANN
The below version numbers and logged changes refer to the MANN package.
Version 0.2.2
- Small documentation changes
- Added
quantize_model
function - Added
build_transformer_block
andbuild_token_position_embedding_block
functions for transformer functionality - Removed unnecessary imports breaking imports in minimal environments
Version 0.2.3
- Per-task pruning
- Functionality for this feature is implemented, but usage is expected to be incomplete. Note that task gradients have to be passed retrieved and passed to the function directly (helper function available), and that the model has to initially be compiled using a compatible loss function (recommended 'mse') to identify gradients.
- It has been found that this functionality is currently only supported for models with the following layers:
- MaskedConv2D
- MaskedDense
- MultiMaskedDense
- Note also that this functionality does not support cases where layers of an individual model are other TensorFlow models, but supporting this functionality is on the roadmap.
- Iterative training using per-task pruning
- Functionality for this feature is implemented, but there are known bugs when trying to apply this methodology to models with the
MultiMaskedConv2D
layer present
- Functionality for this feature is implemented, but there are known bugs when trying to apply this methodology to models with the
Version 0.3.0
- Support for PyTorch layers
- Support for additional custom objects in the
quantize_model
function - Added tests to the package functionality
- Added auto-generated documentation
BeyondML
The below version numbers and changes refer to the BeyondML package
Version 0.1.0
- Refactored existing MANN repository to rename to BeyondML
Version 0.1.1
- Added the
SparseDense
,SparseConv
,SparseMultiDense
, andSparseMultiConv
layers tobeyondml.tflow.layers
, giving users the functionality to utilize sparse tensors during inference
Version 0.1.2
- Added the
MaskedMultiHeadAttention
,MaskedTransformerEncoderLayer
, andMaskedTransformerDecoderLayer
layers tobeyondml.pt.layers
to add pruning to the transformer architecture - Added
MaskedConv3D
,MultiMaskedConv3D
,MultiConv3D
,MultiMaxPool3D
,SparseConv3D
, andSparseMultiConv3D
layers tobeyondml.tflow.layers
- Added
MaskedConv3D
,MultiMaskedConv3D
,MultiConv3D
,MultiMaxPool3D
,SparseConv3D
,SparseMultiConv3D
, andMultiMaxPool2D
layers tobeyondml.pt.layers
Version 0.1.3
- Added
beyondml.pt
compatibility with more native PyTorch functionality for using models on different devices and datatypes - Added
train_model
function tobeyondml.tflow.utils
- Added
MultitaskNormalization
layer tobeyondml.tflow.layers
andbeyondml.pt.layers
Version 0.1.4
- Updated documentation to use Sphinx
Version 0.1.5
- Updated requirements to use newer version of TensorFlow
- Fixed errors with changes to types of
input_shape
in TensorFlow Keras layers - Fixed errors resulting from model/configuration changes with TensorFlow
Version 0.1.6
- Fixed issues with converting between masked and unmasked models in TensorFlow
Version 0.1.7
- Updated Pytorch implementation of Transformer-based architectures
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file beyondml-0.1.7.tar.gz
.
File metadata
- Download URL: beyondml-0.1.7.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c95239b9a1a19a99134ff92d96a64ca0838a7eb4af1df244f6872a533b7f5bd |
|
MD5 | 8676720b22d5284265698a7b66ee7c39 |
|
BLAKE2b-256 | 2f36c050359673f02d2dc7881d61e22f471611cbf430a0626b3ca827d1512a46 |
File details
Details for the file beyondml-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: beyondml-0.1.7-py3-none-any.whl
- Upload date:
- Size: 74.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7095d2312b1d1b937587a1b5054fe07f0a4fea83c4c0cad5c920297bc4127e94 |
|
MD5 | a447d2852ed6721d37b7d5e066c64e60 |
|
BLAKE2b-256 | 51877a8f7c1c56eb9169acc33cf275c17ddbe00dacc157e94b1be1dc5ef9bdd5 |