Training
Detail on the Training Handler class, which provides events and methods to enable mental command training
For simplicity, this training class only provides functionality for mental commands, largely ignoring facial expression functionality. Unless otherwise specified, all methods and events relate specifically to mental commands.
Process
- Load profile 
note: it is possible to perform mental command training without first loading a profile, saving the training to a profile and loading it after.
Cortex.profiles.Load("Jimmy");- Start training 
Cortex.training.Start(MentalCommandNames.Push);- Wait for Success or Failure 
Cortex.training.TrainingSucceeded += OnTrainingSucceeded;
void OnTrainingSucceeded(string headsetId)
{
    // do something
}- Get the training threshold 
Cortex.training.GetTrainingThreshold();
Cortex.training.GetTrainingThresholdResult += OnTrainingThresholdResult;- Accept or Reject the sample based on the threshold and grade 
void OnTrainingThresholdResult(TrainingThreshold trainingThreshold)
{
    if(trainingThreshold.lastTrainingScore > trainingThreshold.currentThreshold)
        Cortex.training.Accept(MentalCommandNames.Push);
    else
        Cortex.training.Reject(MentalCommandNames.Push);
}- Wait for Accepted or Rejected 
Cortex.training.TrainingRejected += OnTrainingRejected;- Repeat from step 2, alternating between neutral and action until satisfied (~14+ samples) 
- Save training to the profile for future use 
Cortex.training.SaveProfile("Jimmy", headsetId);
or
Cortex.profiles.Save("Jimmy", headsetId);The incoming mental command stream will reflect training progress as it advances, including during a sample. There is no need to "apply" the training
Target Session
The training handler will automatically target the most recently created session for ease of use, but it is a good idea to manually set the target session before starting to train.
Mental Command Names
There are a limited number of action names that can be used when training mental commands. To simplify this, the first several available actions are provided as static string literals in the MentalCommandNames class. Generally the only ones you will ever need are neutral, push (action), and maybe a third one for a second action.
public static class MentalCommandNames
{
    public const string Neutral = "neutral";
    public const string Push = "push";
    public const string Pull = "pull";
    public const string Lift = "lift";
    public const string Drop = "drop";
    public const string Left = "left";
    public const string Right = "right";
}Last updated
