Example #1
0
        public void TestDisplayRefresh()
        {
            if (testDisplayModeComboBox.SelectedIndex < 0)
            {
            }
            else if (!RegularExpression.DoubleCheck(minYAxisTestDisplayTextBox.Text))
            {
                MessageBox.Show("Min Y Axis value is worng. Check Please.");

                minYAxisTestDisplayTextBox.Text = "0.0";
                minYAxisTestDisplayTextBox.Focus();
                minYAxisTestDisplayTextBox.SelectAll();
            }
            else if (!RegularExpression.DoubleCheck(maxYAxisTestDisplayTextBox.Text))
            {
                MessageBox.Show("Max Y Axis value is worng. Check Please.");

                maxYAxisTestDisplayTextBox.Text = "1.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (double.Parse(minYAxisTestDisplayTextBox.Text) < 0)
            {
                MessageBox.Show("Min Y Axis value must be 0 or bigger. Check Please.");

                minYAxisTestDisplayTextBox.Text = "0.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (double.Parse(maxYAxisTestDisplayTextBox.Text) <= 0)
            {
                MessageBox.Show("Max Y Axis value must be bigger than 0. Check Please.");

                maxYAxisTestDisplayTextBox.Text = "1.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (double.Parse(maxYAxisTestDisplayTextBox.Text) <= double.Parse(minYAxisTestDisplayTextBox.Text))
            {
                MessageBox.Show("Max Y Axis value must be bigger than min Y Axis value. Check Please.");

                minYAxisTestDisplayTextBox.Text = "0.0";
                maxYAxisTestDisplayTextBox.Text = "1.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (!useTimeStampCheckBox.Checked)
            {
                int maxXAxis = 0;
                foreach (LearningSetup processSetup in learningSetupList)
                {
                    maxXAxis += processSetup.TrainingEpoch;
                }

                testDisplayChart.ChartAreas[0].Area3DStyle.Enable3D = false;

                testDisplayChart.ChartAreas[0].AxisX.Minimum = 0;
                testDisplayChart.ChartAreas[0].AxisX.Maximum = maxXAxis;
                testDisplayChart.ChartAreas[0].AxisY.Minimum = double.Parse(minYAxisTestDisplayTextBox.Text);
                testDisplayChart.ChartAreas[0].AxisY.Maximum = double.Parse(maxYAxisTestDisplayTextBox.Text);

                List <DisplayData> displayDataList = new List <DisplayData>();

                try
                {
                    switch (testDisplayModeComboBox.SelectedIndex)
                    {
                    case 0:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch)
                                {
                                    displayData.InsertValue(testData.MeanSquredError);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch = testData.Epoch;
                                newDisplayData.InsertValue(testData.MeanSquredError);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 1:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch)
                                {
                                    displayData.InsertValue(testData.MeanSemanticStress);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch = testData.Epoch;
                                newDisplayData.InsertValue(testData.MeanSemanticStress);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 2:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch)
                                {
                                    displayData.InsertValue(testData.MeanCrossEntropy);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch = testData.Epoch;
                                newDisplayData.InsertValue(testData.MeanCrossEntropy);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 3:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch)
                                {
                                    if (testData.Correctness)
                                    {
                                        displayData.InsertValue(1);
                                    }
                                    else
                                    {
                                        displayData.InsertValue(0);
                                    }
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch = testData.Epoch;
                                if (testData.Correctness)
                                {
                                    newDisplayData.InsertValue(1);
                                }
                                else
                                {
                                    newDisplayData.InsertValue(0);
                                }
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 4:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch)
                                {
                                    if (testData.MeanActiveUnitActivation == testData.MeanActiveUnitActivation)
                                    {
                                        displayData.InsertValue(testData.MeanActiveUnitActivation);
                                        isExist = true;
                                    }
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                if (testData.MeanActiveUnitActivation == testData.MeanActiveUnitActivation)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.InsertValue(testData.MeanActiveUnitActivation);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                        }
                        break;

                    case 5:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch)
                                {
                                    if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                    {
                                        displayData.InsertValue(testData.MeanInactiveUnitActivation);
                                        isExist = true;
                                    }
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.InsertValue(testData.MeanInactiveUnitActivation);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                        }
                        break;
                    }
                    testDisplayChart.Series.Clear();
                    testDisplayChart.Legends.Clear();

                    Series dataSeries = new Series();
                    dataSeries.ChartType = SeriesChartType.Line;
                    testDisplayChart.Series.Add(dataSeries);

                    foreach (DisplayData displayData in displayDataList)
                    {
                        DataPoint dataPoint = new DataPoint();
                        dataPoint.SetValueXY(displayData.Epoch, displayData.Value);
                        dataSeries.Points.Add(dataPoint);
                    }
                }
                catch
                {
                }
            }
            else if (useTimeStampCheckBox.Checked)
            {
                int maxXAxis = 0;
                foreach (TestData testData in simulator.TestDataList)
                {
                    if (testData.TimeStamp > maxXAxis)
                    {
                        maxXAxis = testData.TimeStamp;
                    }
                }

                testDisplayChart.ChartAreas[0].Area3DStyle.Enable3D   = true;
                testDisplayChart.ChartAreas[0].Area3DStyle.PointDepth = 50;

                testDisplayChart.ChartAreas[0].AxisX.Minimum = 0;
                testDisplayChart.ChartAreas[0].AxisX.Maximum = maxXAxis;
                testDisplayChart.ChartAreas[0].AxisY.Minimum = double.Parse(minYAxisTestDisplayTextBox.Text);
                testDisplayChart.ChartAreas[0].AxisY.Maximum = double.Parse(maxYAxisTestDisplayTextBox.Text);

                List <DisplayData> displayDataList = new List <DisplayData>();

                try
                {
                    switch (testDisplayModeComboBox.SelectedIndex)
                    {
                    case 0:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                {
                                    displayData.InsertValue(testData.MeanSquredError);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch     = testData.Epoch;
                                newDisplayData.TimeStamp = testData.TimeStamp;
                                newDisplayData.InsertValue(testData.MeanSquredError);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 1:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                {
                                    displayData.InsertValue(testData.MeanSemanticStress);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch     = testData.Epoch;
                                newDisplayData.TimeStamp = testData.TimeStamp;
                                newDisplayData.InsertValue(testData.MeanSemanticStress);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 2:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                {
                                    displayData.InsertValue(testData.MeanCrossEntropy);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch     = testData.Epoch;
                                newDisplayData.TimeStamp = testData.TimeStamp;
                                newDisplayData.InsertValue(testData.MeanCrossEntropy);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 3:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                {
                                    if (testData.Correctness)
                                    {
                                        displayData.InsertValue(1);
                                    }
                                    else
                                    {
                                        displayData.InsertValue(0);
                                    }
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch     = testData.Epoch;
                                newDisplayData.TimeStamp = testData.TimeStamp;
                                if (testData.Correctness)
                                {
                                    newDisplayData.InsertValue(1);
                                }
                                else
                                {
                                    newDisplayData.InsertValue(0);
                                }
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;

                    case 4:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                {
                                    if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                    {
                                        displayData.InsertValue(testData.MeanActiveUnitActivation);
                                        isExist = true;
                                    }
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch     = testData.Epoch;
                                    newDisplayData.TimeStamp = testData.TimeStamp;
                                    newDisplayData.InsertValue(testData.MeanActiveUnitActivation);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                        }
                        break;

                    case 5:
                        foreach (TestData testData in simulator.TestDataList)
                        {
                            bool isExist = false;
                            foreach (DisplayData displayData in displayDataList)
                            {
                                if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                {
                                    displayData.InsertValue(testData.MeanInactiveUnitActivation);
                                    isExist = true;
                                    break;
                                }
                            }
                            if (!isExist)
                            {
                                DisplayData newDisplayData = new DisplayData();
                                newDisplayData.Epoch     = testData.Epoch;
                                newDisplayData.TimeStamp = testData.TimeStamp;
                                newDisplayData.InsertValue(testData.MeanInactiveUnitActivation);
                                displayDataList.Add(newDisplayData);
                            }
                        }
                        break;
                    }
                    testDisplayChart.Series.Clear();
                    testDisplayChart.Legends.Clear();
                    testDisplayChart.Legends.Add(new Legend());
                    testDisplayChart.Legends[0].Name = "";

                    Dictionary <int, Series> dataSeriesDictionary = new Dictionary <int, Series>();

                    foreach (DisplayData displayData in displayDataList)
                    {
                        if (!dataSeriesDictionary.ContainsKey(displayData.Epoch))
                        {
                            Series newSeries = new Series();
                            newSeries.ChartType = SeriesChartType.Line;
                            newSeries.Name      = "Epoch" + displayData.Epoch.ToString();
                            testDisplayChart.Series.Add(newSeries);
                            dataSeriesDictionary[displayData.Epoch] = newSeries;

                            LegendItem newLegendItem = new LegendItem();
                            newLegendItem.ImageStyle = LegendImageStyle.Line;
                            //newLegendItem.Name = "Epoch" + displayData.Epoch.ToString();
                            newLegendItem.SeriesName = displayData.Epoch.ToString();
                            testDisplayChart.Legends[0].CustomItems.Add(newLegendItem);
                        }
                        DataPoint dataPoint = new DataPoint();
                        dataPoint.SetValueXY(displayData.TimeStamp, displayData.Value);
                        dataSeriesDictionary[displayData.Epoch].Points.Add(dataPoint);
                    }
                }
                catch
                {
                }
            }
        }
Example #2
0
        public void TestDisplayRefresh()
        {
            if (testDisplayModeComboBox.SelectedIndex < 0)
            {

            }
            else if (!RegularExpression.DoubleCheck(minYAxisTestDisplayTextBox.Text))
            {
                MessageBox.Show("Min Y Axis value is worng. Check Please.");

                minYAxisTestDisplayTextBox.Text = "0.0";
                minYAxisTestDisplayTextBox.Focus();
                minYAxisTestDisplayTextBox.SelectAll();
            }
            else if (!RegularExpression.DoubleCheck(maxYAxisTestDisplayTextBox.Text))
            {
                MessageBox.Show("Max Y Axis value is worng. Check Please.");

                maxYAxisTestDisplayTextBox.Text = "1.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (double.Parse(minYAxisTestDisplayTextBox.Text) < 0)
            {
                MessageBox.Show("Min Y Axis value must be 0 or bigger. Check Please.");

                minYAxisTestDisplayTextBox.Text = "0.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (double.Parse(maxYAxisTestDisplayTextBox.Text) <= 0)
            {
                MessageBox.Show("Max Y Axis value must be bigger than 0. Check Please.");

                maxYAxisTestDisplayTextBox.Text = "1.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (double.Parse(maxYAxisTestDisplayTextBox.Text) <= double.Parse(minYAxisTestDisplayTextBox.Text))
            {
                MessageBox.Show("Max Y Axis value must be bigger than min Y Axis value. Check Please.");

                minYAxisTestDisplayTextBox.Text = "0.0";
                maxYAxisTestDisplayTextBox.Text = "1.0";
                maxYAxisTestDisplayTextBox.Focus();
                maxYAxisTestDisplayTextBox.SelectAll();
            }
            else if (!useTimeStampCheckBox.Checked)
            {
                int maxXAxis = 0;
                foreach (LearningSetup processSetup in learningSetupList) maxXAxis += processSetup.TrainingEpoch;

                testDisplayChart.ChartAreas[0].Area3DStyle.Enable3D = false;

                testDisplayChart.ChartAreas[0].AxisX.Minimum = 0;
                testDisplayChart.ChartAreas[0].AxisX.Maximum = maxXAxis;
                testDisplayChart.ChartAreas[0].AxisY.Minimum = double.Parse(minYAxisTestDisplayTextBox.Text);
                testDisplayChart.ChartAreas[0].AxisY.Maximum = double.Parse(maxYAxisTestDisplayTextBox.Text);

                List<DisplayData> displayDataList = new List<DisplayData>();

                try
                {
                    switch (testDisplayModeComboBox.SelectedIndex)
                    {
                        case 0:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch)
                                    {
                                        displayData.InsertValue(testData.MeanSquredError);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.InsertValue(testData.MeanSquredError);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 1:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch)
                                    {
                                        displayData.InsertValue(testData.MeanSemanticStress);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.InsertValue(testData.MeanSemanticStress);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 2:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch)
                                    {
                                        displayData.InsertValue(testData.MeanCrossEntropy);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.InsertValue(testData.MeanCrossEntropy);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 3:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch)
                                    {
                                        if (testData.Correctness) displayData.InsertValue(1);
                                        else displayData.InsertValue(0);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    if (testData.Correctness) newDisplayData.InsertValue(1);
                                    else newDisplayData.InsertValue(0);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 4:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch)
                                    {
                                        if (testData.MeanActiveUnitActivation == testData.MeanActiveUnitActivation)
                                        {
                                            displayData.InsertValue(testData.MeanActiveUnitActivation);
                                            isExist = true;
                                        }
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    if (testData.MeanActiveUnitActivation == testData.MeanActiveUnitActivation)
                                    {
                                        DisplayData newDisplayData = new DisplayData();
                                        newDisplayData.Epoch = testData.Epoch;
                                        newDisplayData.InsertValue(testData.MeanActiveUnitActivation);
                                        displayDataList.Add(newDisplayData);
                                    }
                                }
                            }
                            break;
                        case 5:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch)
                                    {
                                        if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                        {
                                            displayData.InsertValue(testData.MeanInactiveUnitActivation);
                                            isExist = true;
                                        }
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                    {
                                        DisplayData newDisplayData = new DisplayData();
                                        newDisplayData.Epoch = testData.Epoch;
                                        newDisplayData.InsertValue(testData.MeanInactiveUnitActivation);
                                        displayDataList.Add(newDisplayData);
                                    }
                                }
                            }
                            break;
                    }
                    testDisplayChart.Series.Clear();
                    testDisplayChart.Legends.Clear();

                    Series dataSeries = new Series();
                    dataSeries.ChartType = SeriesChartType.Line;
                    testDisplayChart.Series.Add(dataSeries);

                    foreach (DisplayData displayData in displayDataList)
                    {
                        DataPoint dataPoint = new DataPoint();
                        dataPoint.SetValueXY(displayData.Epoch, displayData.Value);
                        dataSeries.Points.Add(dataPoint);
                    }
                }
                catch
                {

                }
            }
            else if (useTimeStampCheckBox.Checked)
            {
                int maxXAxis = 0;
                foreach (TestData testData in simulator.TestDataList) if (testData.TimeStamp > maxXAxis) maxXAxis = testData.TimeStamp;

                testDisplayChart.ChartAreas[0].Area3DStyle.Enable3D = true;
                testDisplayChart.ChartAreas[0].Area3DStyle.PointDepth = 50;

                testDisplayChart.ChartAreas[0].AxisX.Minimum = 0;
                testDisplayChart.ChartAreas[0].AxisX.Maximum = maxXAxis;
                testDisplayChart.ChartAreas[0].AxisY.Minimum = double.Parse(minYAxisTestDisplayTextBox.Text);
                testDisplayChart.ChartAreas[0].AxisY.Maximum = double.Parse(maxYAxisTestDisplayTextBox.Text);

                List<DisplayData> displayDataList = new List<DisplayData>();

                try
                {
                    switch (testDisplayModeComboBox.SelectedIndex)
                    {
                        case 0:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                    {
                                        displayData.InsertValue(testData.MeanSquredError);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.TimeStamp = testData.TimeStamp;
                                    newDisplayData.InsertValue(testData.MeanSquredError);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 1:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                    {
                                        displayData.InsertValue(testData.MeanSemanticStress);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.TimeStamp = testData.TimeStamp;
                                    newDisplayData.InsertValue(testData.MeanSemanticStress);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 2:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                    {
                                        displayData.InsertValue(testData.MeanCrossEntropy);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.TimeStamp = testData.TimeStamp;
                                    newDisplayData.InsertValue(testData.MeanCrossEntropy);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 3:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                    {
                                        if (testData.Correctness) displayData.InsertValue(1);
                                        else displayData.InsertValue(0);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.TimeStamp = testData.TimeStamp;
                                    if (testData.Correctness) newDisplayData.InsertValue(1);
                                    else newDisplayData.InsertValue(0);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                        case 4:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                    {
                                        if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                        {
                                            displayData.InsertValue(testData.MeanActiveUnitActivation);
                                            isExist = true;
                                        }
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    if (testData.MeanInactiveUnitActivation == testData.MeanInactiveUnitActivation)
                                    {
                                        DisplayData newDisplayData = new DisplayData();
                                        newDisplayData.Epoch = testData.Epoch;
                                        newDisplayData.TimeStamp = testData.TimeStamp;
                                        newDisplayData.InsertValue(testData.MeanActiveUnitActivation);
                                        displayDataList.Add(newDisplayData);
                                    }
                                }
                            }
                            break;
                        case 5:
                            foreach (TestData testData in simulator.TestDataList)
                            {
                                bool isExist = false;
                                foreach (DisplayData displayData in displayDataList)
                                {
                                    if (testData.Epoch == displayData.Epoch && testData.TimeStamp == displayData.TimeStamp)
                                    {
                                        displayData.InsertValue(testData.MeanInactiveUnitActivation);
                                        isExist = true;
                                        break;
                                    }
                                }
                                if (!isExist)
                                {
                                    DisplayData newDisplayData = new DisplayData();
                                    newDisplayData.Epoch = testData.Epoch;
                                    newDisplayData.TimeStamp = testData.TimeStamp;
                                    newDisplayData.InsertValue(testData.MeanInactiveUnitActivation);
                                    displayDataList.Add(newDisplayData);
                                }
                            }
                            break;
                    }
                    testDisplayChart.Series.Clear();
                    testDisplayChart.Legends.Clear();
                    testDisplayChart.Legends.Add(new Legend());
                    testDisplayChart.Legends[0].Name = "";

                    Dictionary<int, Series> dataSeriesDictionary = new Dictionary<int, Series>();

                    foreach (DisplayData displayData in displayDataList)
                    {
                        if (!dataSeriesDictionary.ContainsKey(displayData.Epoch))
                        {
                            Series newSeries = new Series();
                            newSeries.ChartType = SeriesChartType.Line;
                            newSeries.Name = "Epoch" + displayData.Epoch.ToString();
                            testDisplayChart.Series.Add(newSeries);
                            dataSeriesDictionary[displayData.Epoch] = newSeries;

                            LegendItem newLegendItem = new LegendItem();
                            newLegendItem.ImageStyle = LegendImageStyle.Line;
                            //newLegendItem.Name = "Epoch" + displayData.Epoch.ToString();
                            newLegendItem.SeriesName = displayData.Epoch.ToString();
                            testDisplayChart.Legends[0].CustomItems.Add(newLegendItem);
                        }
                        DataPoint dataPoint = new DataPoint();
                        dataPoint.SetValueXY(displayData.TimeStamp, displayData.Value);
                        dataSeriesDictionary[displayData.Epoch].Points.Add(dataPoint);
                    }
                }
                catch
                {

                }
            }
        }