Skip to content

Commit

Permalink
Updated docs with snntorch to Norse example and dev docs (#109)
Browse files Browse the repository at this point in the history
* Updated docs with snntorch to Norse example and dev docs

* Updated docs for porting

---------

Co-authored-by: jegp <jens@jepedersen.dk>
  • Loading branch information
biphasic and Jegp committed Jul 6, 2024
1 parent 95c3f64 commit a2e9318
Show file tree
Hide file tree
Showing 10 changed files with 1,324 additions and 11 deletions.
11 changes: 10 additions & 1 deletion docs/source/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ logo: ../logo_light.png

repository:
url: https://github.com/neuromorphs/nir
branch: main
branch: main
path_to_book: docs/source

execute:
execute_notebooks: off

launch_buttons:
notebook_interface: "jupyterlab"
binderhub_url: "https://mybinder.org/v2/gh/neuromorphs/nir/main?urlpath=lab"
colab_url: "https://colab.research.google.com"
5 changes: 3 additions & 2 deletions docs/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ parts:
- file: examples/snntorch/nir-conversion
- file: examples/spinnaker2/import
- file: examples/spyx/conversion
- file: examples/snntorch_to_norse
- caption: Developer guide
chapters:
- file: porting_nir
- file: api_design
- file: dev
title: Contributing
- file: contributing
10 changes: 9 additions & 1 deletion docs/source/api_design.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API design

The reference implementation simply consists of a series of Python classes that *represent* [NIR structures](primitives).
NIR is simple: it consists of a series of objects that *represent* [NIR structures](primitives).
In other words, they do not implement the functionality of the nodes, but simply represent the necessary parameters required to *eventually* evaluate the node.

We chose Python because the language is straight-forward, known by most, and has excellent [dataclasses](https://docs.python.org/3/library/dataclasses.html) exactly for our purpose.
Expand All @@ -16,6 +16,14 @@ In this example, we create a class that inherits from the parent [`NIRNode`](htt
Instantiating the class is simply `MyNIRNode(np.array([...]))`.

## NIR Graphs and edges
```{figure} nir_graph_example.svg
---
height: 200px
name: nir-graph-example
---
An example of a NIR graph with four nodes: Input, Leaky-Integrator, Affine map, and Output.
```

A collection of nodes is a `NIRGraph`, which is, you guessed it, a `NIRNode`.
But the graph node is special in that it contains a number of named nodes (`.nodes`) and connections between them (`.edges`).
The nodes are named because we need to uniquely distinguish them from each other, so `.nodes` is actually a dictionary (`Dict[str, NIRNode]`).
Expand Down
File renamed without changes.
Loading

0 comments on commit a2e9318

Please sign in to comment.