@@ -0,0 +1,2872 @@
+package ch.unizh.ini.jaer.projects.ziyispikingcnn;%0A%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by ziyihua on 29/03/16.%0A *%0A * The class SpikingCnnStructure builds a structure that stores kernels, biases, spikes, membrane potential and%0A * refractory period for each layer of neurons.%0A *%0A */%0Apublic class SpikingCnnStructure %7B%0A%0A    /**%0A     * The class Network represents a spiking ConvNet. It comprises of class Layer, which can be adapted to input layer,%0A     * convolutional layer and subsampling layer.%0A     *%0A     * The output layer comprises of fcBias (fully connected bias), fcWeights (fully connected weights), fVec (feature vector), outMemPot%0A     * (membrane potential of output neurons), outRefracEnd (time point when the refractory period ends for output neurons),%0A     * outSumSpikes (sum of spikes in the past for output neurons) and outSpikes (spikes of output neurons).%0A     *%0A     * The output layer has a much simpler structure than the other layers so it does not belong to the class Layer.%0A     *%0A     */%0A%0A    public static class Network%7B%0A%0A        public Network()%7Blayers = new ArrayList%3CLayer%3E();%7D%0A%0A        List%3CLayer%3E layers;%0A%0A        float%5B%5D fcBias;%0A        float%5B%5D%5B%5D fcWeights;%0A        float%5B%5D fVec;%0A        float%5B%5D outMemPot;%0A        float%5B%5D outRefracEnd;%0A        double%5B%5D outSumSpikes;%0A        int%5B%5D outSpikes;%0A    %7D%0A%0A    /**%0A     * The class Layer stores b (bias), kernel (list of kernels), memPot (membrane potential), refracEnd (time point%0A     * when the refractory period ends) and spikes (list of spikes for neurons) in a certain layer.%0A     *%0A     * This layer cound be input layer, convolutional layer or subsampling layer depending on information given.%0A     *%0A     * Variables:%0A     *%0A     * membranePot -- stores membrane potential for each neuron in a layer. membranePot is used in propogateSpikingCnn%0A     * while memPot is used in propogateBatchSpikingCnn.%0A     *%0A     * type -- %22i%22 = input, %22c%22 = convolutional, %22s%22 = subsampling.%0A     *%0A     * outMaps -- number of output maps%0A     *%0A     * inMaps -- number of input maps%0A     *%0A     * kernelSize -- size of kernels e.g. 5 means 5x5%0A     *%0A     * scale -- size of the subsampling window e.g. 2 means 2x2%0A     *%0A     * dimX, dimY -- dimensions of output maps, normally dimX=dimY%0A     *%0A     */%0A    public static class Layer%7B%0A%0A        public Layer()%7B%0A            kernel = new ArrayList%3C%3E();%0A            refracEnd = new ArrayList%3C%3E();%0A            memPot = new ArrayList%3C%3E();%0A            spikes = new ArrayList%3C%3E();%0A        %7D%0A%0A        float%5B%5D bias;%0A        List%3Cfloat%5B%5D%5B%5D%3E kernel;%0A        List%3Cfloat%5B%5D%5B%5D%3E memPot;%0A        List%3Cfloat%5B%5D%5B%5D%3E refracEnd;%0A        List%3Cfloat%5B%5D%5B%5D%3E spikes;%0A%0A        float%5B%5D%5B%5D membranePot;%0A        String type;%0A        int outMaps;%0A        int inMaps;%0A        int kernelSize;%0A        int scale;%0A        int dimX;%0A        int dimY;%0A%0A    %7D%0A%7D%0A

structure of spiking cnn, comments added