Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs with snntorch to Norse example and dev docs #109

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading