This tutorial is a step-by-step instruction that teaches you the first steps in cedar's GUI, with special emphasis on DFT. If you are not familiar with DFT at all, it is a good idea to take a look at www.dynamicfieldtheory.org. Note that some steps are marked with a [*]. These steps are optional and can be skipped if you are in a hurry. If you are lost, you can always have a look at the sample solutions, which can be found in cedar's resource folder, at architecture/DFTTutorial.
Please start your cedar gui right now. If you do not know how to do this, take a look at this tutorial.
A sample architecture - linking peaks in cedar
In this section, you will assemble a small DFT architecture that links two one-dimensional estimates along arbitrary metrics, represented by peaks in one-dimensional neural fields, in a two-dimensional neural field by projecting ridges into it.
start off by adding a Gaussian input (called GaussInput) from the Sources tab
set the dimensionality of this input to one by first selecting the element and changing the dimensionality in the property pane
set the size of the element to 100 in the property pane
right-click the element and choose plot all
select the element, change the parameters centers, sigmas, and amplitude, watch what happens
This is a good point to start saving your architecture. Go to file > Save as ... and select an appropriate folder and filename. Hint: (again) save often! The next step is putting this artificial input into a field and creating a peak at the given center.
add a neural field (called NeuralField) from the DFT tab
set the dimensionality and size of the field to match the Gaussian input
drag a connection from the output circle on the right of the Gaussian input to the field's input diamond (to the left)
right-click the field and choose field plot, then right-click the opened plot and pick legend
start the simulation by clicking the play button in the tool bar
watch what happens in the plot after starting the simulation, then start increasing the field's resting level (found in the property pane when the field is selected) until a peak forms
You should now have a peak representing a detection decision on the Gaussian input. Let us now project this peak into a two-dimensional field in form of a ridge.
add a Convolution from the Math Utilities tab and connect the output of the field to the "matrix" input of this element
select the convolution element, look for the kernels entry in the property pane, pick Gauss from the upper drop-down list and press the + on the right — this adds a Gaussian convolution kernel
open up the plot of this convolution and inspect how the convolution kernel smoothes the sigmoided activity of the field
now add a Resize element from the Utilities tab; we will use this to downsample the field activity
connect the output of the convolution to the resize step
select the resize element and set the output size in the property pane to 50 (half the resolution)
[*] you can also try out different interpolation methods
add the last element to this chain, a Projection from the Utilities tab
connect the ouput of the resize element to the input of the projection
to alter the configuration of the projection, you have to first pause the simulation in the tool bar
select the projection, set output dimensionality to two, and the dimension mapping to zero in the property pane
you'll notice that a part of the sizes section turns gray — this indicates that you cannot change this parameter since the preceeding step determines the projection size in this dimension
set the second size to 40 (we will later come back to this)
open the plot of the projection element and inspect the output
add a new field to your architecture, leave it's dimensionality at two, but change its sizes to 50 and 40
connect the projection step to this field's input
For now, there is only one input coming into the two-dimensional field. We will change this now by repeating the steps above, with the following differences:
pick a different size for the Gaussian input and the one-dimensional field—we propose a size of 80—and downsample to half the size (e.g., 40 for the proposed size)
in the projection step, the dimension mapping should map to one now — this entails setting the first size to 50
Now two ridges cross in the two-dimensional field. But wait, there's still no peak in this field!
add a Boost from the Sources tab to your architecture and connect it up to the 2D field
select the boost input and activate it — then increase the strength until you see a peak forming in the 2D field
A sample architecture continued - reading out peaks in cedar
For now, we have created an architecture that links two one-dimensional estimates in a two-dimensional neural field. We now address reading out this linked peak in different ways: peak detection, space-code readout, rate-code readout
add another Projection element and connect the output of the 2D field to the new element, set its output dimensionality to zero
add a StaticGain from the Utilities tab to the output of the projection, and connect the gain's output to a new neural field that is also zero-dimensional and has no interaction kernel (press - on its lateral kernels) — we will call this field a node}; remember to connect this field to the looped trigger
choose a normalization factor (e.g., 0.1) and adjust the static gain appropriately
now tune the resting level of the zero-dimensional node so that it is above threshold once you activate the boost, and below threshold if the boost is inactive (hint: press ctrl+b or go to tools > boost control in the menu to get a tool that allows you to quickly control all boosts in your architecture)
You now have a peak detector in your architecture. We will now read out one-dimensional space-code.
add another Projection to your architecture and connect the 2D field output to it, then set the output dimensionality to one and decide, which dimension should be dropped with the dimension map parameter
look at the resulting projection — notice the similarity between the readout and the input that produced the 2D peak
[*] you can also look at the various compression types and how they affect the projection
We will close this tutorial with the last read-out method — a rate code readout of the peak position
add a SpaceToRateCode element from the DFT tab, connect the space-code readout to this element and also make sure to hook it up to your trigger (hint: elements that need to be connected to a looped trigger always have a little loop icon in their lower right corner)
set lowerLimit and upperLimit of this element to match the ressolution interval of its input: [0,49]
make sure that the 2D field is boosted and look at how the rate code readout matches the peak position along its input — up to a certain degree, which depends on sampling errors introduced in interpolation methods
watch what happens if you deboost the 2D field
[*] think about how a peak detector can assure that the rate code readout is not used while there is no peak in the 2D field
A second architecture - real input in cedar
For the second architecture, make sure that you start off with a fresh and clean architecture canvas by pressing New in the File menu of the GUI. You should also save this architecture in a different file. Start with the following steps:
go to the Sources tab and drag a Picture source into the new architecture, pick an image using the filename parameter — you can use the image blocks.jpg below
build a chain starting at the picture source by adding a ColorConversion, a ChannelSplit (both in Image Processing), and connecting the output channel 2 of the split element with a MatrixTypeConverter (in Utilities) — you do not have to change any parameters, the default parameters are ok!
before connecting this to a 2D field, make sure to smooth the converted output with a convolution and a Gaussian kernel of amplitude 1/255, or roughly 0.004
depending on the size of your chosen image, you might also want to resize the output – you already know how to do that
add a 2D field of this size, connect it to a looped trigger, add a second mode to the lateral kernel (pick Gauss from the drop-down list and press +), set the second mode's amplitude to minus the amplitude of the first mode, double the sigmas, decrease the global inhibition by a factor of 10, increase the resting level to get a peak at every saturated location in your input image
[*] exchange the image input with a camera input after connecting a USB camera to your PC — do not forget to connect the camera input to a trigger