Exemplo n.º 1
0
        public UnsureNetworkForm()
        {
            InitializeComponent();

            NodeSavingReading reader = new NodeSavingReading();

            net = new NeuralNet(7, 7, ANNfilename, KFoldFilename);
            inputTrainingData  = reader.GetStoredDataFromFile(Globals.inputDataStorage);
            outputTrainingData = reader.GetStoredDataFromFile(Globals.outputDataStorage);

            //inputTrainingData = new List<double[]>();
            //outputTrainingData = new List<double[]>();

            controls = new PatsControlScheme();
            controls.Initialize();
            controls.timeNeededForChange = 7000;

            serial = new SerialReader();
            serial.Read();

            UnityCommunicationHub.InitializeUnityCommunication();
            UnityCommunicationHub.TwoWayTransmission();


            indexList        = Globals.GetBasicValues();
            reverseIndexList = Globals.GetBasicValuesReversed();
            setPointList     = Globals.GetBasicPositions();

            foreach (KeyValuePair <string, int> position in indexList)
            {
                DefaultPositionsBox.Items.Add(position.Key);
            }
        }
Exemplo n.º 2
0
        public void Save()
        {
            NodeSavingReading reader = new NodeSavingReading();

            network.Save(ANNfilename);
            reader.pushDataToFile(KFoldFilename, topResults);
        }
Exemplo n.º 3
0
        public NeuralNetForm()
        {
            InitializeComponent();

            NodeSavingReading reader = new NodeSavingReading();

            net = new NeuralNet(8, 7, ANNfilename, KFoldFilename);
            inputTrainingData  = reader.GetStoredDataFromFile(Globals.inputDataStorage);
            outputTrainingData = reader.GetStoredDataFromFile(Globals.outputDataStorage);

            //inputTrainingData = new List<double[]>();
            //outputTrainingData = new List<double[]>();



            serial = new SerialReader();
            serial.Read();

            UnityCommunicationHub.InitializeUnityCommunication();
            UnityCommunicationHub.TwoWayTransmission();


            indexList    = Globals.GetBasicValues();
            setPointList = Globals.GetBasicPositions();

            foreach (KeyValuePair <string, int> position in indexList)
            {
                DefaultPositionsBox.Items.Add(position.Key);
            }
        }
Exemplo n.º 4
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            NodeSavingReading reader = new NodeSavingReading();

            net.Save();
            reader.pushDataToFile(Globals.inputDataStorage, inputTrainingData);
            reader.pushDataToFile(Globals.outputDataStorage, outputTrainingData);
        }
Exemplo n.º 5
0
        //private CrossValidation<ActivationNetwork, double, double> validator;

        public NeuralNet(int inputs, int outputs, string ANNfilename, string KFoldFilename)
        {
            NodeSavingReading reader = new NodeSavingReading();

            this.ANNfilename   = ANNfilename;
            this.KFoldFilename = KFoldFilename;

            try
            {
                network    = (ActivationNetwork)Network.Load(ANNfilename);
                topResults = reader.GetKFoldDataFromFile(KFoldFilename);
            }
            catch (FileNotFoundException e)
            {
                Console.WriteLine("Could not find file, generating new one");
                network = new ActivationNetwork(new SigmoidFunction(), inputs, new int[4] {
                    10, 10, 10, outputs
                });
            }
        }