Dictionary <string, MMNode> createModels(List <MMNodeFactory.Model> modelsToTrain)
        {
            Dictionary <string, MMNode> models = new Dictionary <string, MMNode>();

            int neuronsCount = 50;

            //for (int neuronsCount = 10; neuronsCount < 100; neuronsCount += 20)
            {
                foreach (MMNodeFactory.Model selectedModel in modelsToTrain)
                {
                    //Create the model
                    //MNNodeFactory.Model selectedModel;
                    //Enum.TryParse<MNNodeFactory.Model>(uncastedMdl.ToString(), out selectedModel);
                    models[selectedModel.ToString() + "_" + neuronsCount] = MMNodeFactory.obtain(selectedModel, neuronsCount);

                    MMNode network = models[selectedModel.ToString() + "_" + neuronsCount];
                    network.onEpoch += network_onEpoch;
                    //network.addModality( new Signal(2,1), "XY-t0");
                    //network.addModality( new Signal(2,1), "XY-t1");
                    network.addModality(new Signal(retinaSize * 4, retinaSize), "Vision-t0-Color");
                    network.addModality(new Signal(retinaSize * 2, retinaSize), "Vision-t0-Orientation");
                    //network.addModality(new Signal(retinaSize * 4, retinaSize), "Vision-t0-Shape");
                    network.addModality(new Signal(4, 1), "Saccade");
                    network.addModality(new Signal(retinaSize * 4, retinaSize), "Vision-t1-Color");
                    network.addModality(new Signal(retinaSize * 2, retinaSize), "Vision-t1-Orientation");
                    //network.addModality(new Signal(retinaSize * 4, retinaSize), "Vision-t1-Shape");

                    //Apply a treshold function on the modalities
                    network.onDivergence += network_onDivergence;
                }
            }
            return(models);
        }
示例#2
0
        public HippocampusForm()
        {
            InitializeComponent();
            //--------------------------------------------------------------------------
            //-------------MEC
            mec = new List <IONode>();
            int mecAreas = 1;

            for (int i = 1; i <= mecAreas; i++)
            {
                mec.Add(
                    new IONodeGridCells
                    (
                        new Point2D(2, 1),          //Input, we cheat, this is the odometer values X, Y
                        new Point2D(10, 10),        //Number of grid cells This defines the granularity, it should vary among the MEC
                        0.1,                        //rf size
                        0.5 * i                     //spacing
                    ));

                flowLayoutPanelMEC.Controls.Add(mec.Last().GetCtrl());
            }

            //--------------------------------------------------------------------------
            //--------------LEC
            lec = new List <IONode>();
            int lecAreas = 1;

            for (int i = 1; i <= lecAreas; i++)
            {
                lec.Add(
                    new IONodeAdaptiveSOM
                    (
                        new Point2D(foveaSize, foveaSize), //Input, size of the fovea
                        new Point2D(20, 20),               //Size of the map. Defines the number of templates/filter used.
                        true)                              //USe only winner as output
                    );

                flowLayoutPanelLEC.Controls.Add(lec.Last().GetCtrl());
            }


            //--------------------------------------------------------------------------
            //--------------CA3
            CA3Inputs = new List <SignalLink>();
            CA3       = new MMNodeSOM
                        (
                new Point2D(20, 20),        //Size of the map.
                true                        //Use only the winner for prediction
                        );

            //Add all the MEC modalities
            int counter = 0;

            foreach (IONode n in mec)
            {
                SignalLink link = new SignalLink(n.output, new Signal(n.output));
                CA3.addModality(link.to, "MEC_" + counter++); //note: n.output is cloned, not a reference
                CA3Inputs.Add(link);
            }

            //Add the LEC modalities
            counter = 0;
            foreach (IONode n in lec)
            {
                SignalLink link = new SignalLink(n.output, new Signal(n.output));
                CA3.addModality(link.to, "LEC_" + counter++); //note: n.output is cloned, not a reference
                CA3Inputs.Add(link);
            }
            ctrlMMNode1.attach(CA3);

            //--------------------------------------------------------------------------
            //--------------CA1
            CA1 = new MMNodeLookupTable
                  (
                new Point2D(1, 1)        //Size of the map.
                  );

            CA1.addModality(new Signal(foveaSize, foveaSize), "FOVEA");
            CA1.addModality(new Signal(2, 1), "ODOMETRY");
            ctrlMMNode2.attach(CA1);
        }