public ProcessModifiedHybridFuzzyARTMap( ProcessModifiedHybridFuzzyARTMapParameter parameter) { if (parameter == null) { throw new ArgumentNullException("Parameter mustn't be null."); } this.Parameter = parameter; }
public ProcessModifiedHybridFuzzyARTMap(int inputSize, int targetSize, int numberOfClasses, double basedVigilance, double vigilanceAdjustRate, double weightAdjustRate, double maximumEntropy, double maximumTotalEntropy, double choicingParam, double limitedMse) { ProcessModifiedHybridFuzzyARTMapParameter param = new ProcessModifiedHybridFuzzyARTMapParameter(); param.InputSize = inputSize; param.TargetSize = targetSize; param.NoOfClasses = numberOfClasses; param.ArtABasedVigilance = basedVigilance; param.VigilanceAdjustRate = vigilanceAdjustRate; param.ArtABeta = weightAdjustRate; param.MaximumEntropy = maximumEntropy; param.MaximumTotalEntropy = maximumTotalEntropy; param.ChoicingParam = choicingParam; param.LimitedMseValue = limitedMse; param.Mode = ProcessModifiedHybridFuzzyARTMapMode.DUAL; this.Parameter = param; }
private void btnTrain_Click(object sender, EventArgs e) { // Validate errors. if (txtTrainingFile.Text == string.Empty) { MessageBox.Show(this, "Training file mustn't be empty.", "Error"); return; } if (txtTestFile.Text == string.Empty || txtOutputFile.Text == string.Empty) { MessageBox.Show(this, "Test file and output file mustn't be empty.", "Error"); return; } if (nudInputSize.Value == 0) { MessageBox.Show(this, "Increment size mustn't be zero."); return; } if (nudTargetSize.Value == 0) { MessageBox.Show(this, "Target size mustn't be zero."); return; } if (nudNoOfClasses.Value == 0) { MessageBox.Show(this, "Number of Class mustn't be zero."); return; } // Get process parameter from GUI. if (cbFuzzyARTMAPType.SelectedIndex == 0) { parameter = new ProcessSimplifiedFuzzyARTMapParameter(); } else if (cbFuzzyARTMAPType.SelectedIndex == 1) { parameter = new ProcessOrderedFuzzyARTMapParameter(); ((ProcessOrderedFuzzyARTMapParameter)parameter).NoOfClusters = Convert.ToInt32(nudNoOfClusters.Value); } else { ProcessModifiedHybridFuzzyARTMapParameter hybridParameter = new ProcessModifiedHybridFuzzyARTMapParameter(); if (cbFuzzyARTMAPType.SelectedIndex == 2) { hybridParameter.Mode = ProcessModifiedHybridFuzzyARTMapMode.EXTERNAL; } else { // Recieve input from vigilance adjust rate, // maximum small entropy, maximum total entropy hybridParameter.VigilanceAdjustRate = Convert.ToDouble(nudAdjustVigilanceRate.Value); hybridParameter.MaximumEntropy = Convert.ToDouble(nudMaximumEntropy.Value); hybridParameter.MaximumTotalEntropy = Convert.ToDouble(nudMaximumTotalEntropy.Value); if (cbFuzzyARTMAPType.SelectedIndex == 3) { hybridParameter.Mode = ProcessModifiedHybridFuzzyARTMapMode.INTERNAL; } else if (cbFuzzyARTMAPType.SelectedIndex == 4) { hybridParameter.Mode = ProcessModifiedHybridFuzzyARTMapMode.DUAL; } } parameter = hybridParameter; } // Set common properties of parameter. parameter.InputSize = Convert.ToInt32(nudInputSize.Value); parameter.TargetSize = Convert.ToInt32(nudTargetSize.Value); parameter.NoOfClasses = Convert.ToInt32(nudNoOfClasses.Value); parameter.TrainingFile = txtTrainingFile.Text; parameter.TestingFile = txtTestFile.Text; parameter.ArtABasedVigilance = Convert.ToDouble(nudARTABaseVigilance.Value); parameter.ChoicingParam = Convert.ToDouble(nudARTAChoiceValue.Value); parameter.ArtABeta = Convert.ToDouble(nudARTABeta.Value); parameter.LimitedMseValue = Convert.ToDouble(nudLimitedMSE.Value); parameter.LimitedEpochs = Convert.ToInt32(nudLimitedEpochs.Value); parameter.NormalizedValue = cbNormalizeInputData.Checked; // Process neural network. txtStatus.Text = "Waiting for training...."; selectedTypeOfFuzzyARTMAP = cbFuzzyARTMAPType.SelectedIndex; btnTrain.Enabled = false; btnCancelTrain.Enabled = true; backgroundWorker1.RunWorkerAsync(); }