Skip to content

AP6YC/AdaptiveResonance.jl

Repository files navigation

adaptiveresonance-header

A Julia package for Adaptive Resonance Theory (ART) algorithms.

Documentation Testing Status Coverage Reference
Stable Build Status Codecov DOI
Dev Build Status Coveralls DOI
Documentation Build JuliaHub Status Dependents Release
Documentation pkgeval deps version

Please read the documentation for detailed usage and tutorials.

Contents

Overview

Adaptive Resonance Theory (ART) is a neurocognitive theory of how recurrent cellular networks can learn distributed patterns without supervision. As a theory, it provides coherent and consistent explanations of how real neural networks learn patterns through competition, and it predicts the phenomena of attention and expectation as central to learning. In engineering, the theory has been applied to a myriad of algorithmic models for unsupervised machine learning, though it has been extended to supervised and reinforcement learning frameworks. This package provides implementations of many of these algorithms in Julia for both scientific research and engineering applications. Basic installation is outlined in Installation, while a quickstart is provided in Quickstart. Detailed usage and examples are provided in the documentation.

Usage

Installation

This project is distributed as a Julia package, available on JuliaHub, so you must first install Julia on your system. Its usage follows the usual Julia package installation procedure, interactively:

julia> ]
(@v.10) pkg> add AdaptiveResonance

or programmatically:

julia> using Pkg
julia> Pkg.add("AdaptiveResonance")

You may also add the package directly from GitHub to get the latest changes between releases:

julia> ]
(@v.10) pkg> add https://github.com/AP6YC/AdaptiveResonance.jl

Quickstart

Load the module with

using AdaptiveResonance

The stateful information of ART modules are structs with default constructures such as

art = DDVFA()

You can pass module-specific options during construction with keyword arguments such as

art = DDVFA(rho_ub=0.75, rho_lb=0.4)

For more advanced users, options for the modules are contained in Parameters.jl structs. These options can be passed keyword arguments before instantiating the model:

opts = opts_DDVFA(rho_ub=0.75, rho_lb=0.4)
art = DDVFA(opts)

Train and test the models with train! and classify:

# Unsupervised ART module
art = DDVFA()

# Supervised ARTMAP module
artmap = SFAM()

# Load some data
train_x, train_y, test_x, test_y = load_your_data()

# Unsupervised training and testing
train!(art, train_x)
y_hat_art = classify(art, test_x)

# Supervised training and testing
train!(artmap, train_x, train_y)
y_hat_artmap = classify(art, test_x)

train! and classify can accept incremental or batch data, where rows are features and columns are samples.

Unsupervised ART modules can also accommodate simple supervised learning where internal categories are mapped to supervised labels with the keyword argument y:

# Unsupervised ART module
art = DDVFA()
train!(art, train_x, y=train_y)

These modules also support retrieving the "best-matching unit" in the case of complete mismatch (i.e., the next-best category if the presented sample is completely unrecognized) with the keyword argument get_bmu:

# Get the best-matching unit in the case of complete mismatch
y_hat_bmu = classify(art, test_x, get_bmu=true)

Implemented Modules

This project has implementations of the following ART (unsupervised) and ARTMAP (supervised) modules:

  • ART
    • FuzzyART: Fuzzy ART
    • DVFA: Dual Vigilance Fuzzy ART
    • DDVFA: Distributed Dual Vigilance Fuzzy ART
  • ARTMAP
    • SFAM: Simplified Fuzzy ARTMAP
    • FAM: Fuzzy ARTMAP

Because each of these modules is a framework for many variants in the literature, this project also implements these variants by changing their module options. Variants built upon these modules are:

In addition to these modules, this package contains the following accessory methods:

  • ARTSCENE: the ARTSCENE algorithm's multiple-stage filtering process is implemented as artscene_filter. Each filter stage is implemented internally if further granularity is required.
  • performance: classification accuracy is implemented as performance.
  • complement_code: complement coding is implemented with complement_code. However, training and classification methods complement code their inputs unless they are passed preprocessed=true, indicating to the model that this step has already been done.
  • linear_normalization: the first step to complement coding, linear_normalization normalizes input arrays within [0, 1].

Contributing

If you have a question or concern, please raise an issue. For more details on how to work with the project, propose changes, or even contribute code, please see the Developer Notes in the project's documentation.

In summary:

  1. Questions and requested changes should all be made in the issues page. These are preferred because they are publicly viewable and could assist or educate others with similar issues or questions.
  2. For changes, this project accepts pull requests (PRs) from feature/<my-feature> branches onto the develop branch using the GitFlow methodology. If unit tests pass and the changes are beneficial, these PRs are merged into develop and eventually folded into versioned releases throug a release branch that is merged with the master branch.
  3. The project follows the Semantic Versioning convention of major.minor.patch incremental versioning numbers. Patch versions are for bug fixes, minor versions are for backward-compatible changes, and major versions are for new and incompatible usage changes.

Acknowledgements

Authors

This package is developed and maintained by Sasha Petrenko with sponsorship by the Applied Computational Intelligence Laboratory (ACIL). The users @aaronpeikert, @hayesall, and @markNZed have graciously contributed their time with reviews and feedback that has greatly improved the project.

Support

This project is supported by grants from the Night Vision Electronic Sensors Directorate, the DARPA Lifelong Learning Machines (L2M) program, Teledyne Technologies, and the National Science Foundation. The material, findings, and conclusions here do not necessarily reflect the views of these entities.

Research was sponsored by the Army Research Laboratory and was accomplished under Cooperative Agreement Number W911NF-22-2-0209. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Laboratory or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein.

History

  • 7/10/2020 - Begin project.
  • 11/3/2020 - Complete baseline modules and tests.
  • 2/8/2021 - Formalize usage documentation.
  • 10/13/2021 - Initiate GitFlow contribution.
  • 5/4/2022 - Acceptance to JOSS.
  • 10/11/2022 - v0.6.0
  • 12/15/2022 - v0.7.0
  • 1/30/2023 - v0.8.0
  • 3/21/2024 - v0.8.3

Software

Adaptive Resonance Theory has been developed in theory and in application by many research groups since the theory's conception, and so this project was not developed in a vacuum. This project itself is built upon the wisdom and precedent of decades of previous work in ART in a variety of programming languages. The code in this repository is inspired the following repositories:

Datasets

Boilerplate clustering datasets are periodically used to test, verify, and provide example of the functionality of the package.

  1. UCI machine learning repository
  2. Fundamental Clustering Problems Suite (FCPS)
  3. Nejc Ilc's unsupervised datasets package
  4. Clustering basic benchmark

License

This software is openly maintained by the ACIL of the Missouri University of Science and Technology under the MIT License.

Citation

This project has a citation file file that generates citation information for the package and corresponding JOSS paper, which can be accessed at the "Cite this repository button" under the "About" section of the GitHub page.

You may also cite this repository with the following BibTeX entry:

@article{Petrenko2022,
  doi = {10.21105/joss.03671},
  url = {https://doi.org/10.21105/joss.03671},
  year = {2022},
  publisher = {The Open Journal},
  volume = {7},
  number = {73},
  pages = {3671},
  author = {Sasha Petrenko and Donald C. Wunsch},
  title = {AdaptiveResonance.jl: A Julia Implementation of Adaptive Resonance Theory (ART) Algorithms},
  journal = {Journal of Open Source Software}
}