brainardlab.nben.retina.simulation documentation

correlation-analysis

(correlation-analysis ca)(correlation-analysis ca sig)
This function is used to perform correlation analysis via simulate-retina.  It requires a ref
and an optional seq of signals from a retina.  If the seq is not provided, the function finalizes
the calculation, whose temporary data is stored in the ref, and returns the final correlation
matrix.  If the ref seq is passed, it updates the ref with new correlation information.  The ref
may initially point to nil.

embed-correlation-matrix

(embed-correlation-matrix data dims)
Given a correlation matrix produced by the simulate-retina function in conjunction with the
correlation-analysis mode (the default) or represented as a double[][], yields the non-metric
multidimensional scaling embedding of the negative log of the data squared.

simulate-retinas

(simulate-retinas retinas hs-database & {:keys [image-count analysis finish full-reduce init-reduce image-filter], :or {image-count 25000, full-reduce true}})
Runs the simulation for the given retinas using the given input database.  The retinas argument
may be a single retina or a collection of retinas.  The hs-database argument must be an
hs-cache file name or File object.  The following options may be used:
 :image-count may either be a positive integer or a map of retina to positive integer or a
    collection of positive integers in the same order as retinas.  If such a collection is given
    it may be longer or shorter than the list of retinas, but will cycle upon reaching the end.
    The image count specifies how many images to show to each retina.  The default is 25,000.
 :analysis may be nil or a function that takes a retina and a sequence of signal values from the
    input or a collection of such functions, following the general seq/map form as specified in
    :image-count.

simulate-retinas-hebbian

(simulate-retinas-hebbian retinas hs-database & {:keys [memory image-count dampen timestep steps-per-signal spring-strength distance-fn verbose save-dir], :or {memory 20, image-count 1000, dampen 0.05, timestep 0.0010, steps-per-signal 10, spring-strength 1, distance-fn (let [c (Math/exp -2.0)] (fn* [p1__1827#] (+ 2.0 (* 20.0 (- (Math/exp (* -2.0 p1__1827#)) c)))))}})
Yields a simulation of the retinas (using simulate-retinas), but wraps the call such that all
analysis is done using Hebbian learning implemeted by spring simulation.

simulate-retinas-kohonen

(simulate-retinas-kohonen retinas hs-database & {:keys [grid-size memory image-count radius alpha save-every], :or {grid-size [20 20], memory 20, image-count 500, radius nil, alpha nil, save-every 10}})
Yields a simulation of the retinas (using simulate-retinas), but wraps the call such that all
analysis is done using Kohonen networks.

write-hebbian-simulation

(write-hebbian-simulation output-filename R H)
(write-hebbian-simulation output-filename retina hebbian-sim-result) writes information about
the given retina and result data produced by the Hebbian simulation to the file named by
output-filename.

write-kohonen-simulation

(write-kohonen-simulation output-filename R K)
(write-kohonen-simulation output-filename retina kohonen-sim-result) writes information about
the given retina and resulting data produced by the kohonen simulation to the file named by
output-filename.

write-simulation

(write-simulation output-filename retina corr-mtx & {:keys [embed]})
(write-simulation output-filename retina correlation-sim-result) writes information about the
given retina and correlation matrix produced by the simulation to the file named by
output-filename. If the optional :embed is passed as true, then an embedding is also written.