/// <summary> /// Trains a classifier for each channel so long as (int)minSpikes worth of spikes have been collected /// for that channel in the training buffer. Performs operation on its own thread. /// </summary> public void Train(TrainingParameters trainParam) { Console.WriteLine("Training spike sorter..."); try { switch (trainParam.Type) { case "PCA": Train(); break; case "Maximum Voltage Inflection": Train(trainParam.PeakSample); break; case "Double Voltage Inflection": Train(trainParam.PeakSample, trainParam.MSecToSecondSample, trainParam.SampleFreqHz); break; } trained = true; Console.WriteLine("Spike sorter training complete."); } catch (Exception ex) { Console.WriteLine("Spike sorter training has failed. No sorting will be performed."); Console.WriteLine(ex.Message); } }
private void sorterTrainer_trainSS(object sender, DoWorkEventArgs e) { // Actual training method TrainingParameters tp; if (spikeSorter.projectionType == "Maximum Voltage Inflection") { tp = new TrainingParameters(spikeSorter.projectionType, numPre); spikeSorter.Train(tp); } else if (spikeSorter.projectionType == "PCA") { tp = new TrainingParameters(spikeSorter.projectionType); spikeSorter.Train(tp); } else if (spikeSorter.projectionType == "Double Voltage Inflection") { tp = new TrainingParameters(spikeSorter.projectionType,numPre, 0.4, (int)Properties.Settings.Default.RawSampleFrequency); spikeSorter.Train(tp); } }