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); } }
public void Save() { NodeSavingReading reader = new NodeSavingReading(); network.Save(ANNfilename); reader.pushDataToFile(KFoldFilename, topResults); }
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); } }
private void SaveButton_Click(object sender, EventArgs e) { NodeSavingReading reader = new NodeSavingReading(); net.Save(); reader.pushDataToFile(Globals.inputDataStorage, inputTrainingData); reader.pushDataToFile(Globals.outputDataStorage, outputTrainingData); }
//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 }); } }