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 for
you to run this copy of Topographica, open a terminal window in your
home directory (or a location of your choosing), and run the command:
/group/teaching/cnv/topographica/dice_setup
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. It may take a minute for this to run.
Topographica can be used together with IPython Notebook, which provides a nice command-line interface with plotting and animation support, and these instructions assume that you will be using this interface rather than the separate Tk GUI interface.
First, you will need the IPython Notebook tutorial file
/group/teaching/cnv/topographica/doc/Tutorials/som_retinotopy.ipynb
,
a copy of which will be in the folder ~/topographica/
if
you ran the dice_setup
script from your home
directory. Now start the Topographica IPython Notebook server from
inside the ~/topographica/
folder:
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
to localhost:88XX
where 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
. Continue
pressing Shift+Enter
to run the cells in sequence.
Once you run cell In [7]
, a plot should be generated in
the cell Out [7]
. You should consider what aspect of the
model each plot represents and you can look at
the results
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, and may be using an older version
of the software, but you should find analogous results.
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.
weight_seed
radius_0
alpha_0
retina_density
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
the som_retinotopy
notebook. You can do this by
selecting 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 In [3]
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 30000 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 by prefacing their code with a comment character ("#"); 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 som_retinotopy
notebook, rename it to 'som_modified_input_pattern' and look at
cell In [4]
. You should see the definition of a variable
called 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
x
and y
in
the definition of input_pattern
with:
x = xfn, y = yfn)
Here 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.
First, open the IPython Notebook tutorial file
/group/teaching/cnv/topographica/doc/Tutorials/GCAL_Tutorial.ipynb
,
a copy of which will be in the folder ~/topographica/
as
before. By default, this notebook uses the newer GCAL model, so before
running anything, change line "In [4]" to say 'LISSOM' instead. Then
go through each step as listed. You can compare your output against
the results
here if you wish, though those are from an older version of the code.
When varying each parameter, make sure the others are at their defaults (by omitting them from the test pattern definition), to ensure that the effect of each parameter is considered separately. 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, because of normalization. In these cases, you can sometimes add ".hist()" to the plot to show a histogram that acts as a color scale, but this option does not work with all plot types. In any case, you can always get directly at the data in the plot as shown for "min()" and "max()" in the tutorial, to find out the actual values.
For any of the cases where you argued that the behavior was not biologically realistic, compare the LISSOM results to those from the more recent GCAL model by changing 'LISSOM' back to 'GCAL' in the notebook cell "In [4]". Does GCAL provide more realistic results? Can you see any obvious problems?
For the purposes of this assignment, you can treat the trained GCAL map as the same as LISSOM except for adding contrast gain control (similar to the afferent normalization discussed in the CMVC 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 find yourself doing a lot of runs with different parameters, you could consider using our Lancet package. Lancet lets you easily specify and run big sets of batch simulations that together cover different parameters and conditions, automatically collecting the results as described in our 2013 Frontiers in Neuroinformatics paper. But that's not 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
using the submit
command on Informatics DICE machines
(type man submit
for more details). To allow me to work
with these files efficiently, you must follow these guidelines:
The standard School late policies apply, 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 and School 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.9 2015/02/26 14:12:25 jbednar Exp
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk Please contact our webadmin with any comments or corrections. Logging and Cookies Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh |