In this assignment, you will explore simulations for the development of retinotopy and the function of an orientation map.
You are strongly encouraged to work in pairs of your choosing, in which case you should submit one copy of the assignment, listing your partner, and the mark will be allocated equally to each. Please note, however, that pairs are expected to work on each part together, helping each other understand and figure things out, NOT dividing up the sections to be done separately. Dividing most of the work rather than working jointly will be considered scholastic dishonesty, with the appropriate corresponding penalties.
The assignment uses the Topographica simulator. For this course, we
have installed Topographica in
/group/teaching/cnv/topographica. To make it simple to
run this copy of Topographica, open a terminal window in your home
directory (or a location of your choosing), and run the command:
If you follow the prompts, this script will set up a subdirectory for you to work in for CNV, with links to the site-wide installation.
Topographica can be used together with IPython Notebook, which provides a nice command-line interface with plotting and animation support. This year for the first time we have provided Part 1 of this assignment in IPython Notebook form, and we hope that we will soon be able to do part 2 as well. If you have trouble or if you prefer a more traditional but far less powerful GUI interface, you can follow the instructions from last year instead, which are based on the older GUI tutorial covering exactly the same material.
First, you will need the IPython Notebook tutorial file
a copy of which will be in the folder
you ran the
dice_setup script from your home
directory. Now start the Topographica IPython Notebook server from
cd ~/topographica ./topographica -n
You will see some messages printed to the terminal. In particular,
make a note of the stated port number, typically a number in the range
88XX. In your browser (e.g. Chrome or Firefox), navigate
88XX is this port
number. You should now be able to select the notebook
som_retinotopy from the list.
An IPython notebook is a set of cells that each may contain text,
images, code, etc. Run the notebook by clicking on the first bit of
text on the page and pressing
Shift+Enter to run the cells in sequence.
Once you run cell
In , a plot should be generated in
Out . You should consider what aspect of the
model each plot represents and you can look at
here for comparison. Note that data shown in the static webpage
were generated from a SOM model using higher retinal and cortical
densities than the defaults you are using, but you should find
Continue reading each bit of text and then executing the cells, making sure not to skip or overlook any steps, right up until you reach the final section Exploring the parameters of the SOM. Your notebook will now be running an instance of the SOM model for retinotopy, along with results from that model over the course of development. Note that everything you can see on that web page will be saved automatically with the notebook on disk for later inspection, so you don't need to keep track of it separately, although running new analyses when you load the notebook later will require re-running the cells from the start.
Investigate the effect of changing the four parameters mentioned above, to answer these questions:
To observe how the development of the model is affected when a
parameter is varied, it is good to start by making a clean copy of
som_retinotopy notebook. You can do this by
File -> Make a Copy... from the menu at the
top of the
som_retinotopy notebook in the browser. You
can now click on the notebook name (displayed at the top of the
page), which is normally something like "som_retinotopy-Copy0". You
should edit the name to something meaningful that will help you keep
track of all your notebooks as you change the different parameters
of the SOM. Specify your chosen values in cell
and restart the kernel (
Kernel -> Restart from the
menu). This will clear the active Python environment so that when
you click on
Cell -> Run All, the whole notebook will
be run from scratch with your new parameters.
Once you have a number of notebooks with different parameters for the SOM, you can start examining the differences between them. You can compare results across browser tabs, or by opening two browser windows side by side. Once you're ready to write your report, you can collect images from the notebooks using right-click and your browser's "Save Image As" function.
Note that you usually won't need to run all the way to 40000 iterations to see what's happening, as it should be clear by about 10000 iterations whether it is going to organize properly or not. You can also omit any of the visualizations you are not interested in; you don't need to run every plot and every animation for every different parameter (since only a small subset will end up in your report).
Also note that changing any density effectively also changes the weight_seed, because the number and thus pattern of weights will differ for different sizes.
Create a new copy of the original
notebook, rename it to 'som_modified_input_pattern' and look at
In . You should see the definition of a variable
input_pattern. Add these lines before this
variable is defined:
import random def xfn(): return random.gauss(0,0.2) def yfn(): if (random.uniform(0,1)>0.5): return random.gauss(-0.25,0.1) else: return random.gauss(+0.25,0.1)Now replace the lines specifying
yin the definition of
x = xfn, y = yfn)
random.uniform returns a uniform random number in
the given range, while
random.gauss returns a normally
distributed (i.e., Gaussian) random number with the
given (mean,stddev). What topographic grid pattern do you
expect the SOM to develop in this case? Describe and briefly
justify your expectations. Please do this part before
the next question; what's important is that you try to reason
out what the network will do, not that your prediction actually
matches what you find in practice. Your mark will be based on
how you are reasoning about it, not on whether what you expect
to occur does happen.
The overall goal of this part is to demonstrate that you understand how the SOM algorithm works, and particularly how the behavior is determined by the parameters and the distribution of input patterns, so be sure to make this clear in your responses.
NOTE: As of February 18th, these instructions have been updated to use the new IPython Notebook version of the tutorial. The content covered by this new notebook version is the same as before. You are encouraged to switch to the notebook format but if you have already started this section already and wish to carry on with the Tk GUI, you may continue following last year's instructions for Part 2.
If you have already run the
dice_setup script, you
will need to copy the notebook
topographica folder. Otherwise, this file will be
found in your
topographica directory after running the
setup script. The two snapshot files
lissom_oo_or_10000.typ are also available
/group/teaching/cnv/topographica/ in case you have
trouble generating your own snapshots later on.
As described in Part 1, you can start the Topographica IPython
Notebook server from inside the
~/topographica/ folder as
cd ~/topographica ./topographica -n
cd command appropriately if
topographica folder is not located in your home
Open the notebook
GCAL_tutorial in your browser, after
noting the port number and navigating to
as described in the introduction to Part I of the assignment. In code
cell of the section titled (Optional) Exploring the older LISSOM
model set the
model variable to the
'LISSOM', replacing the default
'GCAL'. Now run every cell from the top of the
notebook to the bottom by pressing
each cell in turn.
Note that the first time you run through the notebook, you may to
need to wait a couple of minutes for a new snapshot to be generated in
the section titled Loading the model. If you have trouble
generating the snapshot (e.g if it takes much longer than expected)
you can try using the
group/teaching/cnv/topographica/ by copying
it into your
Make sure to consider the effect of modifying each parameter independently. For each parameter, report your observations on how the LISSOM map responds:
Note that when varying the scale or offset, it is very easy to get confused by the plots. The highest activity is shown as 100% white and zero activity is shown as 100% black. You should always be able to see the overall pattern of activity but the absolute activity values are obscured. The best way to evaluate the underlying activity values is to get the raw numpy array as shown in the Activity statistics subsection of Presenting a test stimulus.
For any of the cases where you argued that the behavior
was not biologically realistic, compare the LISSOM results to
those from a model we recently developed called GCAL (in
examples/gcal.ty). You can explore GCAL by restarting
the kernel (
Kernel -> Restart) and restoring the default
model = 'GCAL' in the section
titled (Optional) Exploring the older LISSOM model) before
re-running the notebook.
A static reference of what the notebook should look like when
exploring the GCAL model may be
here. As when you loaded the LISSOM model, you may need to wait a
few minutes for a new GCAL snapshot to be generated
gcal_10000.typ is available if you have any issues). Does
GCAL provide more realistic results? Can you see any obvious
For the purposes of this assignment, you can just treat the trained GCAL map as the same as LISSOM except for adding contrast gain control (similar to the afferent normalization discussed in the text), but if you want to see more about GCAL, it is described in Stevens et al. J. Neuroscience 2013.
Although your assignment need not be as polished as a publication, the guidelines described in Topographica's section on generating high-quality figures can be helpful. If you are using results generated in a notebook, you can simply save images with right-click and your browser's "Save Image As" function. If you are using the Tk GUI, instead of awkwardly grabbing screenshots, you can save plots using Python commands like:
save_plotgroup("Projection",projection=topo.sim['V1'].projections('Afferent'))More information about saving output from the Tk GUI using Python commands is available in the Preparing your assignment portion of last year's instructions.
If you care to get into it, there is a command called
that does this all automatically, making it simple to override
parameters, run a set of analyses at a list of specified iterations,
and automatically put the parameter changes into every filename. If
you're even more ambitious, you can use our
Lancet package to run big
sets of batch simulations together covering different parameters and
conditions, automatically collecting the results together as described
Frontiers in Neuroinformatics paper. But none of that is required
for the CNV course; it's just mentioned here to make sure that no one
goes off and tries to duplicate this functionality themselves.
Your work must be submitted by the deadline
submit command on Informatics DICE machines
man submit for more details). To allow me to work
with these files efficiently, you must follow these guidelines:
Standard late policies will apply as described in your course guide, namely that late coursework is not accepted without good reason, which must be discussed with the ITO, not the lecturer. Similarly, standard academic misconduct policies apply as described in the University guidelines; in particular; students must clearly label any aspect of their submission that is not their own independent work (or that of their named partner).
Example of submit command:
submit cnv 1 asst1.pdf
Be sure that you provide evidence that you did each part of this assignment. I can only judge what is actually submitted, so you should make sure that the files you submit make it clear that you have done everything, and thought about everything.
Be sure to cite any information that you use that is not from the course material or your own experience. Including such information is encouraged, but it must be properly cited. You can use the CMVC book Bibliography database for citation information for any paper cited in the CMVC text.
Submissions MUST use PDF, so that I can be sure to be able to read them and so that I can process all submissions from all students uniformly. Other formats like .doc or .sxw have a certain probability of working, but the probability is far from 1.0, and they cause a lot of problems. Naming and formatting the files as I require will make my job a lot easier and will make sure you get credit for everything you do, because I will be able to see exactly what you are submitting for each problem.
Please read and follow my list of writing tips.
Last update: assignment1.html,v 1.21 2014/02/18 15:43:40 s0787336 Exp
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: firstname.lastname@example.org
Please contact our webadmin with any comments or corrections. Logging and Cookies
Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh