/// <summary>Trains SVM with self data</summary> public void SelfTrain() { try { SVM = new MultiClassSVM(SelfTSet); } catch { } }
private TrainingSet tSet; //, testSet; #endregion Fields #region Constructors /// <summary>Constructor. Loads and classifies face dataset if desired</summary> /// <param name="TrainFaceDataset">Load and classify face dataset?</param> public CLObjClassifier(bool TrainFaceDataset) { if (CLCalc.CLAcceleration == CLCalc.CLAccelerationType.Unknown) CLCalc.InitCL(); if (TrainFaceDataset) { LoadMITFaceClassifier(); SVM = new MultiClassSVM(tSet); InitKernel(); } }
/// <summary>Constructor. Loads parameters from a file.</summary> /// <param name="svmFile">File to read</param> public CLObjClassifier(string svmFile) { if (CLCalc.CLAcceleration == CLCalc.CLAccelerationType.Unknown) { CLCalc.InitCL(); } SVM = new MultiClassSVM(new TrainingSet()); SVM.SVMs.Add(new SVM()); SVM.Classifications.Add(1.0f); SVM.SVMs[0].Load(svmFile); InitKernel(); }
/// <summary>Constructor. Loads and classifies face dataset if desired</summary> /// <param name="TrainFaceDataset">Load and classify face dataset?</param> public CLObjClassifier(bool TrainFaceDataset) { if (CLCalc.CLAcceleration == CLCalc.CLAccelerationType.Unknown) { CLCalc.InitCL(); } if (TrainFaceDataset) { LoadMITFaceClassifier(); SVM = new MultiClassSVM(tSet); InitKernel(); } }
/// <summary>Loads and classifies dataset</summary> private void LoadMITFaceClassifier() { /* * * CBCL Face Database #1 * MIT Center For Biological and Computation Learning * */ string p = System.Windows.Forms.Application.StartupPath; string fileTrain = p + "\\svm.train.normgrey"; string fileTest = p + "\\svm.test.normgrey"; tSet = new TrainingSet(); //Fills both, we're not testing the results FillTrainingSet(fileTrain, tSet); FillTrainingSet(fileTest, tSet); SVM = new MultiClassSVM(tSet); }
/// <summary>Constructor. Loads parameters from a file.</summary> /// <param name="svmFile">File to read</param> public CLObjClassifier(string svmFile) { if (CLCalc.CLAcceleration == CLCalc.CLAccelerationType.Unknown) CLCalc.InitCL(); SVM = new MultiClassSVM(new TrainingSet()); SVM.SVMs.Add(new SVM()); SVM.Classifications.Add(1.0f); SVM.SVMs[0].Load(svmFile); InitKernel(); }
/// <summary>Loads and classifies dataset</summary> private void LoadMITFaceClassifier() { /* CBCL Face Database #1 MIT Center For Biological and Computation Learning * */ string p = System.Windows.Forms.Application.StartupPath; string fileTrain = p + "\\svm.train.normgrey"; string fileTest = p + "\\svm.test.normgrey"; tSet = new TrainingSet(); //Fills both, we're not testing the results FillTrainingSet(fileTrain, tSet); FillTrainingSet(fileTest, tSet); SVM = new MultiClassSVM(tSet); }