<p>If you want to build a neural network as a biological simulation, maybe none of these are the best options, since they are more suitable for deep neural networks. If you want to mimic synapses using some model as Hodgkin and Huxley, you must use some different approaches. For that, you may use NEURON environment (<a href="https://neuron.yale.edu/neuron/" rel="nofollow noreferrer">https://neuron.yale.edu/neuron/</a>), which has some implementations of the theoretical models behind action potentials. It comes with a gui, but personally I don't like it, so I just code everything using their python's library. </p>

<p>On the other hand, if you are just looking for a way to model a network, without adding too much complexity, then any of your examples are probably are ok to build directed graphs.</p>

CC BY-SA 4.0
2019-08-22T07:28:57.747Z
2019-08-22T07:28:57.747Z
julix
<p>If you're looking at computational models of actual neurons and biological neural networks, there are a number of tools out there which are specifically for the purpose. The most commonly used are:</p>

<ul>
<li><a href="https://www.nest-simulator.org/" rel="nofollow noreferrer">NEST</a> is well maintained and a common tool for network dynamics.</li>
<li><a href="https://brian2.readthedocs.io/" rel="nofollow noreferrer">Brian2</a> is flexible and easy to use.</li>
<li><a href="https://www.neuron.yale.edu/neuron/" rel="nofollow noreferrer">NEURON</a> is particularly popular when one is interested in biologically detailed single neurons and their interactions.</li>
</ul>

<p>Writing bio-plausible neural models in Tensorflow or Torch is certainly possible, but those tools are particularly useful when you want to efficiently <em>train</em> a network (normally by backpropagation), and bio-plausible models are not commonly written using these tools. However, I am aware of at least two tools that simulate <em>spiking</em> networks in Torch. These are used because the authors were interested in porting models similar to convolutional neural networks, but with spikes:</p>

<ul>
<li><a href="https://github.com/miladmozafari/SpykeTorch" rel="nofollow noreferrer">SpykeTorch</a> High-speed simulator of convolutional spiking neural networks with at most one spike per neuron. </li>
<li><a href="https://gitlab.com/aiCTX/sinabs" rel="nofollow noreferrer">Sinabs</a> used to port CNNs to neuromorphic hardware</li>
</ul>

CC BY-SA 4.0
2019-08-23T19:06:16.863Z
2019-08-23T19:06:16.863Z
Martino
<p>I would be very grateful to people with experience in using neural network models in neuroscience for advice!</p>

<p>What approach would you recommend for building neural networks?</p>

<p>I am choosing between TensorFlow, PyTorch and Keras. An important aspect for me is to be able to easily access the params of the NN (especially the weights). I want to build encoding models of biological neurons so for me model transparency, interpretability and exploration capacity is as important (if not more) than performance metrics or efficiency.</p>

<p>Thanks!</p>

CC BY-SA 4.0
2019-08-22T09:31:34.040Z
Welcome! Overall I believe this is a good question. You state quite specifically what you are trying to achieve and why you are asking for this information. However, the starting sentence is begging for 'opinion-based' answers, which is not a suitable question on Stack Exchange, as you will learn by reading the help section. You could edit the question to make more clear you are asking specifically for recommendations in terms of "encoding models of biological neurons" in which "transparency, interpretability and exploration capacity" is the most important.
Steven Jeuris
<theoretical-neuroscience><computational-modeling><neural-network>
ML/Neuroscience: TensorFlow vs PyTorch vs Keras for bulding NN models of the nervous system?
phant0msp1ke
# ML/Neuroscience: TensorFlow vs PyTorch vs Keras for bulding NN models of the nervous system?

(Asked by: username_0 on 2019-08-19)

I would be very grateful to people with experience in using neural network models in neuroscience for advice!

What approach would you recommend for building neural networks?

I am choosing between TensorFlow, PyTorch and Keras. An important aspect for me is to be able to easily access the params of the NN (especially the weights). I want to build encoding models of biological neurons so for me model transparency, interpretability and exploration capacity is as important (if not more) than performance metrics or efficiency.

Thanks!

**Tags:** theoretical-neuroscience, computational-modeling, neural-network

> **Comments:**
> **username_1**: Welcome! Overall I believe this is a good question. You state quite specifically what you are trying to achieve and why you are asking for this information. However, the starting sentence is begging for 'opinion-based' answers, which is not a suitable question on Stack Exchange, as you will learn by reading the help section. You could edit the question to make more clear you are asking specifically for recommendations in terms of "encoding models of biological neurons" in which "transparency, interpretability and exploration capacity" is the most important.  

---

## 2 answers

### Answer by username_3 on 2019-08-23. Score: 4

If you're looking at computational models of actual neurons and biological neural networks, there are a number of tools out there which are specifically for the purpose. The most commonly used are:

* [NEST](https://www.nest-simulator.org/) is well maintained and a common tool for network dynamics.
* [Brian2](https://brian2.readthedocs.io/) is flexible and easy to use.
* [NEURON](https://www.neuron.yale.edu/neuron/) is particularly popular when one is interested in biologically detailed single neurons and their interactions.

Writing bio-plausible neural models in Tensorflow or Torch is certainly possible, but those tools are particularly useful when you want to efficiently *train* a network (normally by backpropagation), and bio-plausible models are not commonly written using these tools. However, I am aware of at least two tools that simulate *spiking* networks in Torch. These are used because the authors were interested in porting models similar to convolutional neural networks, but with spikes:

* [SpykeTorch](https://github.com/miladmozafari/SpykeTorch) High-speed simulator of convolutional spiking neural networks with at most one spike per neuron.
* [Sinabs](https://gitlab.com/aiCTX/sinabs) used to port CNNs to neuromorphic hardware


---

### Answer by username_2 on 2019-08-22. Score: 3

If you want to build a neural network as a biological simulation, maybe none of these are the best options, since they are more suitable for deep neural networks. If you want to mimic synapses using some model as Hodgkin and Huxley, you must use some different approaches. For that, you may use NEURON environment (<https://neuron.yale.edu/neuron/>), which has some implementations of the theoretical models behind action potentials. It comes with a gui, but personally I don't like it, so I just code everything using their python's library.

On the other hand, if you are just looking for a way to model a network, without adding too much complexity, then any of your examples are probably are ok to build directed graphs.


---

