Abstract
wisardpkg is an open-source C++/Python library designed for Weightless Artificial Neural Networks (WANNs), specifically the WiSARD model and its modern extensions. By shifting the paradigm from weighted synapses to RAM-based memory addressing, this library offers a high-performance, low-power alternative for online learning, classification, and regression tasks.
Introduction
Traditional artificial neural networks (ANNs) rely on computationally expensive weighted synapses and iterative optimization techniques like backpropagation. While effective, these models often demand significant power and introduce latency, particularly in edge computing and online learning scenarios. Weightless Artificial Neural Networks (WANNs) provide a compelling alternative. Instead of weights, they utilize RAM-based neurons where learning is a simple memory-writing operation and inference is a memory-reading operation.
Despite their efficiency, the adoption of WANNs has been hindered by the lack of a unified, high-performance, and accessible library. wisardpkg addresses this gap by providing a modular framework for the Wilkes, Stonham and Aleksander Recognition Device (WiSARD) architecture and its variants.
The WiSARD Architecture
The core of the library is the classic WiSARD model, an $n$-tuple classifier. It organizes memory into "discriminators," which are sets of RAM nodes. During training, binary input patterns are sampled to form addresses; the corresponding memory locations in the discriminators are then marked.
To handle learning saturation—where too many memory locations are filled, leading to classification ties—wisardpkg implements a "bleaching" mechanism. This uses access counters and dynamic thresholds to filter out infrequent patterns during inference, maintaining discriminative power.
Library Features and Extensions
wisardpkg is built with a C++ core for execution speed and a Python wrapper via pybind11 for ease of use. It implements several advanced variants:
- ClusWiSARD: This extension allows a single class to be represented by multiple discriminators, enabling unsupervised sub-clustering to handle heterogeneous data within a single category.
- Regression WiSARD: This model adapts weightless logic for continuous value prediction. Instead of simple binary flags, memory locations store cumulative sums of target values ($y$) and access counts. During inference, the model returns an average of the stored values.
- ClusRegression WiSARD: A hybrid model combining the clustering capabilities of ClusWiSARD with regression functionality.
Binarization and Preprocessing
A fundamental requirement for WANNs is binary input. To lower the barrier to entry, wisardpkg includes a dedicated Binarization module. It provides built-in tools like Thermometer encoding and KernelCanvas to transform quantitative and time-series data into suitable binary formats, streamlining the pipeline from raw data to weightless inference.
Applications
While this paper focuses on the library implementation, the underlying WiSARD models have demonstrated success across diverse domains, including data stream clustering, GPS trajectory classification, part-of-speech tagging, financial credit analysis, and audio processing. The library's efficiency makes it particularly suited for real-time applications on resource-constrained hardware.
Conclusion
wisardpkg provides a modern, cross-platform implementation of weightless neural architectures. By enabling one-pass learning and high-speed RAM lookups, it offers a viable path for low-latency machine learning applications. The library is released under the MIT license and is compatible with Python 3.7+ and C++11. Future work continues to explore the theoretical bounds and memory scaling optimizations for these unique models.
Summary updated