Welcome to mgng
An experimental implementation of the Merge Growing Neural Gas algorithm. The project turned into an exercise for using state-of-the-art python tools. This project has been created with my cookiecutter for science projects
The Growing Neural Gas and Merge Growing Neural Gas Algorithms
Growing Neural Gas (NGN) is a topology preserving (see this blog for a demonstration) or this explaination) extension to the Neural gas (NG) approach is usefull for learning when an underlying topology is not known (as in the case of the Self-organizing maps (SOM) algorithm). When it comes to time series data (such as trajectories), an extension to the neural gas algorithm has been approached (Merge Neural Gas (MNG)) and a combination with the GNG leads to the Merge growing neural gas (MNGN) approach. It adds a context memory to the neurons of the NGN and is useful for recognising temporal sequences and with a single weighting parameter, can be reduced to a regular NGN for which an implementation is available.
This packages implements the MGNG algorithm as a vanilla numpy implementation (which can be executed on the GPU with Cupy). The package uses modern python tools such as poetry, attrs (a focus has been laid on those two for this release), and sphinx and mypy/pylint/black for documentation and coding standards.
See the notebooks in the repective subfolder of the project root and the documentation.
Installation and development
First make sure to install Python (^3.7) the dependency management tool Poetry then create an isolated virtual environment and install the dependencies:
poetry install
Per terminal session, the following command should be executed to activate the virtual environment.
poetry shell
To generate the documentation run:
cd doc/
make api # optional, only when the code base changes
make html
To run unit tests, run:
pytest --log-level=WARNING
# Specify a selected test
pytest --log-level=DEBUG -k "TestExample"
pytest --log-level=DEBUG tests/test_example.py::TestExample::test_example
To work with VisualStudio Code:
cp .vscode/template.settings.json .vscode/settings.json
which python # copy the path without the executable
and add the path to the virtual environment to in the "python.pythonPath" setting.
cp .vscode/template.settings.json .vscode/settings.json
which python # copy the path without the executable
and add the path to the virtual environment to in the "python.pythonPath" setting.
Metadata
Release files for lemonpy-mgng 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lemonpy_mgng-0.1.1.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lemonpy_mgng-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.2 kB
Release files / lemonpy_mgng-0.1.1.tar.gz
| Download URL | lemonpy_mgng-0.1.1.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a0209b873b4c5f4f4787554dfbf57c87d96977a5d2bca43f806fb9c760e3b01
|
|
BLAKE2b-256 checksum How to use checksums |
e813799da862c5043ea8eb001436b35b81c211588f5ee1de487492265cb95698
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.8.8 Linux/5.19.0-35-generic
|
Release files / lemonpy_mgng-0.1.1-py3-none-any.whl
| Download URL | lemonpy_mgng-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a18c4ad6d2303de0eb1d0a95f40cc24fa1fe0fcc8c7b9f334e010ba566a33e79
|
|
BLAKE2b-256 checksum How to use checksums |
301e895343a3f129731745fddff975ef0b81be1394106aec333477e667660d11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.8.8 Linux/5.19.0-35-generic
|