My Machine Learning (MML) Library, a high performance machine learning and deep learning framework coding from scratch (pure Python) with hybrid backend support (`numpy` or `torch`)... Write `import mml` to use it.
Project description
MML (mml-pypi)
My Machine Learning (MML) Library developed by Nathmath and DOF Studio, identified as mml-pypi on PyPI.
What is MML? Why MML?
-
It is a high performance machine learning and deep learning framework coding from scratch (pure Python) with hybrid backend support (
numpyortorch). -
It is a pure Python implementation and almost has production level performance (significantly higher in neural nets) as fantastic toolkit for
quick application,library comparision, andquick benchmarkingwith. -
It is a package with utilities covering from Data IO, Feature Engineering, and Data Transforming, not only and far from simply a machine learning library, but a deeply integrated environment you can do everything on one set.
-
Its code is completely light-weight and open-source suitable for teaching, learning, deploying, and even debugging. You will never forget how
integrated,simple, andpowerfulMML can be before starting to code on it. -
Its style is designed for experts as well as non-experts -- we have a complete set of nn modules and
Auto Neural Networkframework, which can automaticallybuild,train,fine-tune, andevaluatea neural network natively useful for non-technical groups.
Latest Version: 0.0.6
For more information:
-
GitHub homepage: https://github.com/dof-studio/MML
-
PyPI homepage: https://pypi.org/project/mml-pypi
How to Start
# bash:
pip install mml-pypi
# Python:
import mml
from mml import Matrix
# Create my first MML.Matrix
mmatrix = Matrix([[1., 2.], [3, 5.]], backend="numpy")
print(mmatrix)
# For further tutorials, see `./document`
# Recommend to start from `1. General.md` and try the must-run example first.
Update History
MML 0.0.6 Release:
- Minor bugs fixed.
- Some document updates.
- New methods including
swapaxesandmasked_fillare provided inMatrixandTensorcontainers. - New attention modules arrived, including
MultiHeadAttention(MHAfor abbr.),AttentionPooling1D(AP1Dfor abbr.), and accordingly, the transformers implementations -TransformerEncoder(TFEncfor abbr.) andTransformerDecoder(TFDecfor abbr.). Transformer layers are versatile enough and allows you to choose yourattentionimplementation,nonlinearimplementation, andactivationimplementation. - New FFN related modules arrived, including the traditional
FFNmodule, and official support ofSwiGLUmodule. - Provided an implementation of
LayerNormso that tensors can flow without being drifted up. - Provided more options to initialize neural network weights, including
xavier(default),kaiming, andrand(legacy). This functionality is enabled - Minor update of
Auto Neural Networksystem and it was made more powerful.
Planned Updates:
Within 0.0.6.x:
-
More Document updates.
-
Cliplayer, manually supports clipping to avoid overfitting in classification tasks. -
Reshapelayer, a generic reshaping tool supplementary to the currentFlatten. -
Residuallayer, a generic residual connection tool that can be used without manual implementation. -
More
Poolinglayers, useful in CNN or LSTM related architectures. -
Introduce
Dropoutlayers between Recurrent blocks. -
Kernel PCAimplementation for simpler but stronger dimensionality reduction. -
KNNandK-meansalgorithms for regression and clustering. -
More
AutoNNarchitecture and tasks support.Later versions:
-
Conv1DandConv2Dlayers and pre-trained models (likeMobileNet) for audio and image neural network tasks. -
GRUlayers, serves as a simpler version of LSTM. -
More
Lossfunctions likeWMSE,WRMSE, etc. to support weighted average. -
More
Lossfunctions designed for financial engineers to develop strategies. -
Auto Neural Networksupport for audio and image style tasks. -
GANandRLframework, incorporated into the current Neural Network framework. -
More
AutoNNarchitecture and tasks support.
MML 0.0.5 Release:
- Minor bugs fixed.
- Some document updates.
- New methods
erfanderfinvare provided inMatrixandTensorcontainers. - New Activations like
GELU,ELU,SELU,SiLU, ... are implemented. - More abbreviations like
RM,BCM,MCM,BCE,MCE... are included. - Global support of better Auto-Encoder arch by introducing a
forward_encodermethod from the basenn_Module, andpredict_encoderinEvaluator. - Global support of
Auto ForwardandAuto Backwardsystems. Users can only define a sequential network in__init__without concerning its forward and backward passes by manual labor. - Formal introduction of
Auto Neural Networksystem, supportingtabularandtime-seriesdata modelling (will be continuously updating in the future). - Try
nn.AutoNNnow!
Version Control
From versions starting from 0.0.x, Viewable Version Control (VVC) tools will be installed with this library. With VVC
enabled, you can clear filter and see what has changed on a specific function or argument from a specific version to a specific version. Database will record any change starting from version 0.0.x.1 (next minor update to 0.0.x).
- Note:
Viewable Version Control (VVC)is also aDOF Studioowned open-source repository. - See
https://github.com/dof-studio/VVCfor more information about this version control tool.
To use this version control tool for MML, you may need to manually install it from this GitHub homepage: https://github.com/dof-studio/MML
- Update:
VVCdevelopment is delayed because of lack of resources.
License
Apache 2.0 License, with no warranty but grants the right for even commercial use.
What's Inside?
-
Containers.
-
ML Algorithms.
-
Neural Network Framework (and Simple Interfaces).
-
Utilities and Toolkits.
-
Free ML Tutorial, Project Examples, and Documents.
Everything coded from scratch!
See below for a quick and complete reference.
Containers using Mixed Backends
- Matrix (n-dimensional, For ML Algorithms) (NumPy √ Torch √)
- Tensor (n-dimensional, For NN Framework) (NumPy √ Torch √)
ML Algorithms from Scratch
- Linear Models (OLS and FGLS)
- Generalized Linear Models (FGLS with Activation)
- Time Series Models (TS, ARIMAX)
- Principal Component Analysis (PCA)
- Support Vector Machine (SVM)
- Classification And Regression Tree (CART)
- Linear Regression Tree Wrapper (LRTW)
- Random Forest (RF)
- Gradient Boosting Machine (GBM)
- Extreme Gradient Boosting Machine (XGBM)
- ...
Neural Network Framework from Scratch
- Basic Overridable Neural Network Module (Module)
- Dense Layer (Dense)
- Dropout Layer (Dropout)
- Flatten Layer (Flatten)
- Normalization Layers (LayerNorm, ...)
- Single or Stacked RNN Layer (RNN)
- Swish Gated Linear Unit Layer (SwiGLU)
- Single or Stacked LSTM Layer (LSTM)
- Pooling Layers (AttentionPooling1D, ...)
- Attention Layers (MHA, ...)
- Feed Forward Layer (FFN)
- Transformer Layers (TransformerEncoder, TransformerDecoder, ...)
- Activation Layers (ReLU, LeakyReLU, ELU, SELU, GELU, SiLU, ...)
- Loss Functions (MSE, RMSE, MAE, BCE, MCE, ...)
- Optimizers (SGD, Adam, AdamW, ...)
- Easy Interface for Evaluation (Evaluator)
- Auto Neural Network Framework (AutoNN)
- ...
Utilities from Scratch
- Regression, Binary Classification, Multi Classification Metrics
- Train-Test Split, Train-Test Split for Time Series, Rolling Window Maker
- Data Scalers
- Data Wrangling Toolkits
- Easy Save and Load Interface
- Generic Optimizer
- Generic Bootstrap Sampler
- Generic Visualization Toollits
- ...
Documentation in Detail (New and Is Updating)
See ./document for more information.
Recommended learning curve:
1. General.md2. Containers.md3. Machine Learning Models.md4. Neural Netwotk Framwwork.md5. Simple Interface and AutoNN System.md
Project Based Examples (Legacy)
-
Homework_1_Q1_TimeSeries.ipynb
-
Homework_1_Q2_PCA.ipynb
-
Homework_1_Q3_SVM.ipynb
-
Homework_2_Q1_Tree.ipynb
-
Homework_2_Q2_RandomForest.ipynb
-
Homework_2_Q3_Bagging_with_Linear_Regression.ipynb
-
Homework_3_Q1_Logistic_Regression.ipynb
-
Homework_3_Q2_Gradient_Boosting_with_Decision_Trees.ipynb
-
Homework_3_Q3_Multilayer_Perceptron.ipynb
-
Homework_4_Q1_Vanilla_RNN.ipynb
-
Homework_4_Q2_LSTM.ipynb
-
Homework_4_Q3_Autoencoders.ipynb
Contact core developers
Please open an issue at https://github.com/dof-studio/MML if you find a bug or functionality problem.
To directly contact the developer team, send an e-mail to dof.hbx@gmail.com (can't ensure to be replied).
We welcome and value any positive contribution to this repository.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mml_pypi-0.0.6.tar.gz.
File metadata
- Download URL: mml_pypi-0.0.6.tar.gz
- Upload date:
- Size: 262.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e53b9a052dd004fc23d02f7ec73ca0e3b630dc2df5e698c13e5b24285111852
|
|
| MD5 |
49a8836f36309b5f261cc78068e3abd5
|
|
| BLAKE2b-256 |
a6754eaafeff4c8521ba58f4dd1744b7e7427e006e9ca962f7392a2ef950c4a1
|
File details
Details for the file mml_pypi-0.0.6-py3-none-any.whl.
File metadata
- Download URL: mml_pypi-0.0.6-py3-none-any.whl
- Upload date:
- Size: 300.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f6025a3dd0d1b41479f5106d49b77de9c2767dbd707ce2532ca657a70c05352
|
|
| MD5 |
240a429ed849605b5f1df4cbe2491ee3
|
|
| BLAKE2b-256 |
fa0a56e0c3b544fbfc1b36850af74b1ccae34b50c35b75578f831bd0064292a8
|