kmheckel / spyx

Spyx: Spiking Neural Networks in JAX
https://spyx.readthedocs.io/en/latest/
MIT License
102 stars 12 forks source link

Stevenabreu7 nir #16

Closed kmheckel closed 1 year ago

kmheckel commented 1 year ago

From my understanding/experience yes, they are always ordered.

On Wed, Oct 25, 2023, 17:01 Steven Abreu @.***> wrote:

@.**** commented on this pull request.

In spyx/nir.py https://github.com/kmheckel/spyx/pull/16#discussion_r1372002158:

+

  • elif isinstance(node, nir.Scale): # not needed atm
  • pass
  • elif isinstance(node, nir.Delay): # not needed atm
  • pass
  • elif isinstance(node, nir.Threshold): # not needed atm
  • pass
  • +def to_nir(spyx_pytree, input_shape, output_shape) -> nir.NIRGraph:

  • """Converts a Spyx network to a NIR graph."""
  • construct the edge list for the NIRGraph

  • keys = list(spyx_pytree.keys())
  • edges = [(keys[i], keys[i + 1]) for i in range(len(keys) - 1)] # assume linear connectivity

will the keys of the pytree always be ordered? if not, the edges of the NIR graph would be incorrect, wouldn't they?

— Reply to this email directly, view it on GitHub https://github.com/kmheckel/spyx/pull/16#pullrequestreview-1697748228, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMG7YKF25CSOGWLOQXGVZMTYBEZVVAVCNFSM6AAAAAA6PCSPCWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTMOJXG42DQMRSHA . You are receiving this because you authored the thread.Message ID: @.***>