pyaogmaneo
raw JSON → 2.14.4 verified Sat May 09 auth: no python
Python bindings for the AOgmaNeo library, a spiking neural network algorithm for online learning. Current version 2.14.4. Release cadence is irregular, with occasional updates.
pip install pyaogmaneo Common errors
error ModuleNotFoundError: No module named 'aogmaneo' ↓
cause The module name is 'aogmaneo' but the PyPI package name is 'pyaogmaneo'. Users may try `import pyaogmaneo` which is wrong.
fix
Install with
pip install pyaogmaneo and import with import aogmaneo. error ImportError: cannot import name 'Network' from 'aogmaneo' ↓
cause The 'Network' class was removed in version 2.0.0. The old API is no longer available.
fix
Use 'Hierarchy' instead. See the quickstart example for correct usage.
Warnings
gotcha Import as 'from aogmaneo import ...' NOT 'from pyaogmaneo import ...'. The package installs as pyaogmaneo but the module is aogmaneo. ↓
fix Use 'from aogmaneo import Encoders' or 'import aogmaneo'.
breaking In version 2.x, the API changed significantly from 1.x. The old 'Network' and 'Layer' classes are removed. Use 'Hierarchy' and 'Encoders' instead. ↓
fix Migrate to new API: replace Network with Hierarchy, use Encoders for input encoding.
Imports
- Encoders
from aogmaneo import Encoders - Hierarchy
from aogmaneo import Hierarchy - compute
from aogmaneo import compute
Quickstart
from aogmaneo import Encoders, Hierarchy, compute
import numpy as np
# Create encoders
input_sizes = [10]
encoder = Encoders(1, input_sizes)
# Create hierarchy
hierarchy = Hierarchy(encoder.numOutputs, 2, 512)
# Input data
input_data = np.random.rand(10).astype(np.float32)
# Step
encoding = encoder.encode(input_data)
hierarchy.step(encoding, 0.01, 0.0, 0.0)
# Get output
output = hierarchy.getOutputs()
print(output)