Answers.Body: <p>The challenge you've identified is a notable limitation in most existing neuromorphic computing frameworks, including Nengo. Generally, these frameworks are designed for static network configurations, meaning the number of neurons, connections, and other properties are fixed at compile time.</p>
  <p>Workarounds in Nengo:</p>
  <ul>
  <li><p>Multiple Models: One option could be to pre-compile multiple models with different numbers of neurons, and switch between them at runtime depending on your condition. This approach would not be seamless but could offer a way to adapt to changing conditions.</p>
  </li>
  <li><p>Dynamic Nodes: Nengo allows the inclusion of Python functions via nodes that can be part of your model. You could potentially write a custom node that mimics the behavior of having a different number of neurons, though this would be quite involved and wouldn't leverage the underlying neuromorphic hardware.</p>
  </li>
  <li><p>Parameter Modulation: While not changing the number of neurons, you could potentially change their behavior dynamically by modulating other parameters like firing rates, synaptic weights, etc., based on your condition.</p>
  </li>
  </ul>
  <p>Other Frameworks:</p>
  <ul>
  <li><p>TensorFlow / PyTorch for Spiking Neural Networks: These general-purpose machine learning libraries are increasingly adding support for spiking neural networks and can offer more flexibility in dynamically changing the network configuration. However, deploying them on specialized neuromorphic hardware could be challenging.</p>
  </li>
  <li><p>Is there specialized hardware, specifically designed for spiking neural networks? Changing the number of neurons on-the-fly may not be straightforward though.</p>
  </li>
  <li><p>Custom Solution: Building a custom solution tailored to your specific needs could be the most flexible option, though also the most time-consuming. This would involve developing your spiking neural network model at a lower level, perhaps even directly interfacing with the neuromorphic hardware if possible.</p>
  </li>
  </ul>
  <p>While there are no straightforward solutions, the above options could provide a viable path forward depending on your specific requirements and constraints.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-15T15:08:45.983Z
Answers.Text: Hello, thank you so much for the detailed reply. I was thinking of either trying the synaptic weight modification in Nengo, or trying TensorFlow / PyTorch for Spiking Neural Networks. Do you have any resources on how to change synaptic weights at runtime in Nengo, or the network configuration in Tensorflow for SNNs?
Answers.UserDisplayName: elli al
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-15T21:28:07.500Z
Answers.Text: For Nengo: Would nengo.Node to create a function that modifies synaptic weights based on some condition at runtime work? Look into Nengo's documentation on nengo.Connection and nengo.Node for better insights.
Answers.UserDisplayName: Roel Van de Paar
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-15T21:29:54.663Z
Answers.Text: For TensorFlow/PyTorch: Explore the Norse library which extends PyTorch for SNNs (https://github.com/norse/norse). In TensorFlow, you may find the tf.keras built-in functionalities for SNNs useful. Additionally, look into the BindsNET library (https://github.com/BindsNET/bindsnet) which provides a bridge between TensorFlow and PyTorch for SNNs.
Answers.UserDisplayName: Roel Van de Paar
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-13T04:41:55.133Z
Answers.LastActivityDate: 2023-10-13T04:41:55.133Z
Answers.UserDisplayName: Roel Van de Paar
Body: <p>I'd like to build a spiking neural network and deploy it in neuromorphic hardware. I'd like to modify the number of neurons of a population at runtime, depending on a condition.</p>
  <p>Frameworks like Nengo don't seem to support such modifications at runtime. Is there any workaround that could be used? Does any other framework support runtime modifications on the number of neurons (and other properties)?</p>
  
Tags: <neuromorphic-engineering><spiking-neural-networks>
Title: Modifying the population neurons at runtime - Framework and resources
UserDisplayName: elli al
ThreadText: # Modifying the population neurons at runtime - Framework and resources
  
  (Asked by: username_0 on 2023-10-11)
  
  I'd like to build a spiking neural network and deploy it in neuromorphic hardware. I'd like to modify the number of neurons of a population at runtime, depending on a condition.
  
  Frameworks like Nengo don't seem to support such modifications at runtime. Is there any workaround that could be used? Does any other framework support runtime modifications on the number of neurons (and other properties)?
  
  **Tags:** neuromorphic-engineering, spiking-neural-networks
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-10-13. Score: 1 | Accepted answer
  
  The challenge you've identified is a notable limitation in most existing neuromorphic computing frameworks, including Nengo. Generally, these frameworks are designed for static network configurations, meaning the number of neurons, connections, and other properties are fixed at compile time.
  
  Workarounds in Nengo:
  
  * Multiple Models: One option could be to pre-compile multiple models with different numbers of neurons, and switch between them at runtime depending on your condition. This approach would not be seamless but could offer a way to adapt to changing conditions.
  * Dynamic Nodes: Nengo allows the inclusion of Python functions via nodes that can be part of your model. You could potentially write a custom node that mimics the behavior of having a different number of neurons, though this would be quite involved and wouldn't leverage the underlying neuromorphic hardware.
  * Parameter Modulation: While not changing the number of neurons, you could potentially change their behavior dynamically by modulating other parameters like firing rates, synaptic weights, etc., based on your condition.
  
  Other Frameworks:
  
  * TensorFlow / PyTorch for Spiking Neural Networks: These general-purpose machine learning libraries are increasingly adding support for spiking neural networks and can offer more flexibility in dynamically changing the network configuration. However, deploying them on specialized neuromorphic hardware could be challenging.
  * Is there specialized hardware, specifically designed for spiking neural networks? Changing the number of neurons on-the-fly may not be straightforward though.
  * Custom Solution: Building a custom solution tailored to your specific needs could be the most flexible option, though also the most time-consuming. This would involve developing your spiking neural network model at a lower level, perhaps even directly interfacing with the neuromorphic hardware if possible.
  
  While there are no straightforward solutions, the above options could provide a viable path forward depending on your specific requirements and constraints.
  
  > **Comments:**
  > **username_0**: Hello, thank you so much for the detailed reply. I was thinking of either trying the synaptic weight modification in Nengo, or trying TensorFlow / PyTorch for Spiking Neural Networks. Do you have any resources on how to change synaptic weights at runtime in Nengo, or the network configuration in Tensorflow for SNNs?  
  > **username_1**: For Nengo: Would nengo.Node to create a function that modifies synaptic weights based on some condition at runtime work? Look into Nengo's documentation on nengo.Connection and nengo.Node for better insights.  
  > **username_1**: For TensorFlow/PyTorch: Explore the Norse library which extends PyTorch for SNNs (https://github.com/norse/norse). In TensorFlow, you may find the tf.keras built-in functionalities for SNNs useful. Additionally, look into the BindsNET library (https://github.com/BindsNET/bindsnet) which provides a bridge between TensorFlow and PyTorch for SNNs.  
  
  ---
  
  