<< Main Manual 

Tutorial #7. Writing Custom Utility Scripts

This tutorial assumes that you have completed Tutorial #6.

Creating a Network with Multiple Neuron Types

Now, we are interested in mixing together a network with multiple types of neurons. First, we will start by adding a new .oden file to our models directory to define a new type of neuron:

Now, we run 'nne_build' as usual.

> nne_build

Now, we need to build a .net file,

zca.setup:
Network zca.net                                    
Dt 0.05                                    
Print Step Size 1                         
Output VVs                                 # We just output the VVs for each of the 50 neurons to save disk space
Output On Network: VVs                     # Also, average the VVs across the network and output to network.txt
Raster: VVs 7.0                            # Generate a raster diagram using the VVs to determine when a change >7 mV occurs
Experiment control 1
                      
Change VVs = gauss(-70.0, 5.0)

An easier and more flexible way of adding multiple types is to use the Python scripts that came with NeuronetExperimenter. From the command-line

> cd NeuronetExperimenter-simulations
> python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from nne.Network import *             
# This allows us access to a Network object we will use to build our network
>>> network = Network()    
>>> network.addNeurons('zca', 10)
>>> network.addNeurons('Butera', 5)
>>> network.save('tut6_1.net')
Saving Network to: tut6_1.net
>>> quit()
>

Take a look at the tut6_1.net file in a text editor and you should see that there are 10 zca neurons followed by 5 Butera neurons, and their associated parameters and initial conditions as we defined them in the original .oden files.

Suppose we want to add random connections from each zca neuron to the Butera neurons and vice versa. Rather than generating an adjacency matrix as tutorial #4 showed, or doing this by hand in the .net file (uggghhhh), we can use our Python access to each neuron directly:

> python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from nne.Network import *             
# This allows us access to a Network object we will use to build our network
>>> network = Network()    
>>> network.load('tut6_1.net')            
# Load the network we were working with from the last example
Loading Network: tut6_1.net
>>>




<< Main Manual