GCAL CollectorΒΆ

GCAL Collector

This notebook demonstrates how you can collect measurements and analyze data over development using the Collector class.

In [1]:
%reload_ext topo.misc.ipython
Executing user startup file /var/lib/buildbot/docs/.topographicarc

Defining the data to be collected

In [2]:
import topo
from topo.analysis import Collector
from topo.submodel.gcal import ModelGCAL, ArraySpec

Hypercolumn distance estimation requires scipy.optimize

In [3]:
from topo.analysis.command import measure_or_pref
from featuremapper.analysis.raster import fft_power
from featuremapper.analysis.pinwheels import PinwheelAnalysis
from featuremapper.analysis.hypercolumns import PowerSpectrumAnalysis

from holoviews import Points

We will now define the GCAL model specification:

In [4]:
topo.sim.model = ModelGCAL(cortex_density=47)
gcal = topo.sim.model.specification

Collector can be configured to collect Sheet and Projection activities, Projection weights, the output of featuremapper measurements, array data (here the V1 homeostatic threshold) and can be instructed to analyze any of these sources with the analyze method:

In [5]:
c = Collector()

# Projection activities
c.Activity.LGNOnAfferent =  c.collect(gcal.projections.V1.LGNOnAfferent)
c.Activity.LGNOffAfferent = c.collect(gcal.projections.V1.LGNOffAfferent)

# OR preference measurement
c.collect(measure_or_pref)
# Sheet activities
c.Activity.Retina =         c.collect(gcal.sheets.Retina)
c.Activity.V1 =             c.collect(gcal.sheets.V1)
# Connection fields
c.CFs.LGNOnAfferent =       c.collect(gcal.projections.V1.LGNOnAfferent,  grid=True)
c.CFs.LGNOffAfferent =      c.collect(gcal.projections.V1.LGNOffAfferent, grid=True)
# Homeostatic threshold
c.HomeostaticThreshold.V1 = c.collect(ArraySpec('V1.output_fns[0].t'), 
                                                group='Homeostatic Threshold')
# Analysis
c.Pinwheels.V1 =            c.analyze(c.ref.OrientationPreference.V1
                                      * c.ref.OrientationSelectivity.V1, PinwheelAnalysis)
c.FFTAnalysis.V1 =          c.analyze(c.ref.OrientationPreference.V1, PowerSpectrumAnalysis)

Now to instantiate and load the model:

In [6]:
topo.sim()

Finally, we define the measurement times and run the collector:

In [7]:
times = [500*i for i in range(31)]
print("Collection will start at iteration %d and end on iteration %d" % (min(times), max(times)))
Collection will start at iteration 0 and end on iteration 15000

In [8]:
data = c(times=times)
100% measurement progress 00:00:05

Sheet and projection activities

Here are both the projection activities (top row) and sheet activies (bottom row)

In [9]:
data.Activity.display('all').cols(2)
Out[9]:
Time:

Connection fields (weights)

Here are the weights on the ON surround and OFF surround RGC+LGN projections:

In [10]:
(data.CFs.LGNOnAfferent + data.CFs.LGNOffAfferent).select(Time=(0, 15000, 16))
Out[10]:
Time: