public RBF() // Use it for Testing One Sample from The Saved Data
 {
     Class    = new ReadData[4];
     Class[0] = new ReadData("\\Dataset\\Training Dataset\\Closing Eyes", 1);
     Class[1] = new ReadData("\\Dataset\\Training Dataset\\Looking Down", 2);
     Class[2] = new ReadData("\\Dataset\\Training Dataset\\Looking Front", 3);
     Class[3] = new ReadData("\\Dataset\\Training Dataset\\Looking Left", 4);
 }
Esempio n. 2
0
        public MLP(double pEta, int pEpochs, bool pBias, List <int> pNumNodesperHiddenLayer, bool readfile)
        {
            open             = false;
            p                = new Process();
            numHiddenLayers  = pNumNodesperHiddenLayer.Count;
            accuracy         = 0;
            desiredOutputs_D = new int[4] {
                0, 0, 0, 0
            };
            Errors = new double[4];
            pNumNodesperHiddenLayer.Add(4); //num of weights_HO per output Layer
            NumNodesperEachLayer_IHO = pNumNodesperHiddenLayer;
            NumNodesperEachLayer_IHO.Insert(0, 19);
            biasLst = new List <List <double> >();
            NumOfWeightsPerEachLayer = new List <int>();
            NetInputs     = new List <List <double> >();
            actualOutputs = new List <List <double> >();
            Deltas        = new List <List <double> >();

            int numOfPreviousWeights = 19;  //intial of numof weights_HO for input weights_HO

            for (int i = 0; i < numHiddenLayers + 1; numOfPreviousWeights = pNumNodesperHiddenLayer[i + 1], i++)
            {
                NumOfWeightsPerEachLayer.Add((numOfPreviousWeights * pNumNodesperHiddenLayer[i + 1]));
            }

            Class = new ReadData[4];

            Class[0] = new ReadData("\\Dataset\\Training Dataset\\Closing Eyes", 1);
            Class[1] = new ReadData("\\Dataset\\Training Dataset\\Looking Down", 2);
            Class[2] = new ReadData("\\Dataset\\Training Dataset\\Looking Front", 3);
            Class[3] = new ReadData("\\Dataset\\Training Dataset\\Looking Left", 4);
            Normalize_Data();

            weights_HO = new List <List <double> >();
            RandomList = new List <int>();
            eta        = pEta;
            Bias       = pBias;
            epochs     = pEpochs;
            if (readfile)
            {
                ReadWeightFromFile();
            }
            else
            {
                Generate_Random_Weights();
            }
            alpha           = 1;
            confusionMatrix = new int[4, 4] {
                { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
            };
        }