Visualisation tool for the Neuromorphic Intermediate Representation
Reason this release was yanked:
Incorrect import
Project description
Neuromorphic Intermediate Representation Visualisation Tool
Turn your NIR definitions into a nice graph, the original publication serving as a template.
Customise your node colour preferences in style.yml, and quickly generate graphs from your neuromorphic networks.
This work is in progress.
Running Example (Jupyter Notebook)
By running the following code (from a notebook),
import nir
import nirviz
import numpy as np
a = np.random.randn(2)
ir = nir.NIRGraph(
nodes={
"input": nir.Input(input_type=np.array([2])),
"affine1": nir.Affine(weight=np.zeros((2,2)), bias=False),
"cu1": nir.CubaLIF(tau_mem=a, tau_syn=a, r=a, v_leak=a, v_threshold=a, v_reset=a),
"affine_rec": nir.Affine(weight=np.zeros((2,2)), bias=False),
"affine2": nir.Affine(weight=np.zeros((2,2)), bias=False),
"cu2": nir.CubaLIF(tau_mem=a, tau_syn=a, r=a, v_leak=a, v_threshold=a, v_reset=a),
"output": nir.Output(output_type=np.array([2]))
},
edges=[("input", "affine1"), ("affine1", "cu1"), ("affine_rec", "cu1"), ("cu1", "affine_rec"), ("cu1", "affine2"), ("affine2", "cu2"), ("cu2", "output")])
viz = nirviz.visualize(ir)
viz.show()
You would get the following visualisation
Similar to Figure 3 of the publication.
Running example (CLI)
To convert a saved NIR graph (e.g. srnn.nir) to a PNG or SVG, you can use one of the following commands:
python -m nirviz srnn.nir # SVG -> stdout
python -m nirviz srnn.nir img/srnn.png # PNG -> file
python -m nirviz srnn.nir img/srnn.svg # SVG -> file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nirviz-0.1.1.tar.gz.
File metadata
- Download URL: nirviz-0.1.1.tar.gz
- Upload date:
- Size: 71.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d602f967f4e8a9208df10f025d8087a387a7063d9d0541981cb1aa895696cd3
|
|
| MD5 |
bfaa9e2af89efb39a775b8ea1e5362e7
|
|
| BLAKE2b-256 |
308a56d32d97d56721909f5967ce2ebf8ea3841e6b30ceb2cfc46b98973bd0ec
|
File details
Details for the file nirviz-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nirviz-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bd612c612032506930b6f2d0a9d4dd84da1b94d2b3a23667b7900a921363b10
|
|
| MD5 |
adedb9a283a480267de756dbf2f36d98
|
|
| BLAKE2b-256 |
e3051252e646227b61de4f66af788b12d5e43b0affc27a1f4cf77499b35d64a3
|