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.