//************************Logistic Regression*********************** //학습 버튼 private void RL_LearnBox_Click(object sender, EventArgs e) { DataProcessing process = new DataProcessing(); try { Parallel.Invoke ( //true data data shiping* () => { //true 데이터 분할 1 process.DataLoop("True", true); }, () => { //true 데이터 분할2 process.DataLoop("True", false); }, //false data data shiping* () => { //false 데이터 분할1 process.DataLoop("False", true); }, () => { //false 데이터 분할2 process.DataLoop("False", false); } ); process.LabelOuput(); Property.logistic = new Logistic(); Property.logistic.CalculateLogistic(Property.inputs, Property.outputs); Property.saveButton = true; RL_LearnDataSaveBox.Enabled = true; RL_ForwardBox.Enabled = true; RL_BackwardBox.Enabled = true; RL_RunNumberBox.Enabled = true; if (Property.CameraConected == true) { RL_AotoRunBox.Enabled = true; RL_StopAotoRunBox.Enabled = true; } else { RL_AotoRunBox.Enabled = false; RL_StopAotoRunBox.Enabled = false; } MessageBox.Show("학습 완료. 저장 가능"); } catch { Property.saveButton = false; MessageBox.Show("학습 실패."); } }
//학습 버튼 private void LearnBox_Click(object sender, EventArgs e) { DataProcessing process = new DataProcessing(); try { Parallel.Invoke ( //true data data shiping* () => { //true 데이터 분할 1 process.DataLoop("True", true); }, () => { //true 데이터 분할2 process.DataLoop("True", false); }, //false data data shiping* () => { //false 데이터 분할1 process.DataLoop("False", true); }, () => { //false 데이터 분할2 process.DataLoop("False", false); } ); process.LabelOuput(); Property.saveButton = true; LearnDataSaveBox.Enabled = true; ForwardBox.Enabled = true; BackwardBox.Enabled = true; NumberBox.Enabled = true; if (Property.CameraConected == true) { AutoRunBox.Enabled = true; StopAutoRunBox.Enabled = true; } else { AutoRunBox.Enabled = false; StopAutoRunBox.Enabled = false; } MessageBox.Show("학습 완료. 저장 가능"); } catch { Property.saveButton = false; MessageBox.Show("학습 실패."); } }