Skip to main content

mgng

Project description

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.

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

lemonpy_mgng-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

lemonpy_mgng-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file lemonpy_mgng-0.1.1.tar.gz.

File metadata

  • Download URL: lemonpy_mgng-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.8.8 Linux/5.19.0-35-generic

File hashes

Hashes for lemonpy_mgng-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1a0209b873b4c5f4f4787554dfbf57c87d96977a5d2bca43f806fb9c760e3b01
MD5 8befaea8180db9815d9e8ba2257d312e
BLAKE2b-256 e813799da862c5043ea8eb001436b35b81c211588f5ee1de487492265cb95698

See more details on using hashes here.

File details

Details for the file lemonpy_mgng-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lemonpy_mgng-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.8.8 Linux/5.19.0-35-generic

File hashes

Hashes for lemonpy_mgng-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a18c4ad6d2303de0eb1d0a95f40cc24fa1fe0fcc8c7b9f334e010ba566a33e79
MD5 7a2ef572c00bbafdc1e6eee15d125945
BLAKE2b-256 301e895343a3f129731745fddff975ef0b81be1394106aec333477e667660d11

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