Leave-out-one cross validation during neural network training
Hello there I am trying to train a ML model with leave-out-one trial cross validation. Right now I have input data stored in the 1×10 cell array: "XTrain" with each cell containing the prediction inputs for all 10 trials and another 1×10 cell array: "YTrain" that contains the correposding continous variable we are trying to predict/output.
net = connectLayers(net,outputName,"fc");
% Specify training options
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 60, …
‘MiniBatchSize’, 1, …
‘SequenceLength’, ‘longest’, …
‘InputDataFormats’, ‘CTB’, …
‘Plots’, ‘training-progress’, …
‘Metrics’, ‘rmse’, …
‘Verbose’, 0 …
‘Validation);
% Train the network
net = trainnet(XTrain,YTrain,net,"mse",options)
I have built my model’s network architecture stored in "net", but I am unsure of how to incorporte "leave out one trial" validation during training and then test my model’s performance. I want the model to pull out one trial at a time and then train the model and continue to do this for all 10 trials so that I end up with one final network trained and validated on all the trials. But I also want to have data to test the model’s performance? Do I need to create a loop for this? or is there a way I can specify this in the training options? Any help would be greatly appreciated!Hello there I am trying to train a ML model with leave-out-one trial cross validation. Right now I have input data stored in the 1×10 cell array: "XTrain" with each cell containing the prediction inputs for all 10 trials and another 1×10 cell array: "YTrain" that contains the correposding continous variable we are trying to predict/output.
net = connectLayers(net,outputName,"fc");
% Specify training options
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 60, …
‘MiniBatchSize’, 1, …
‘SequenceLength’, ‘longest’, …
‘InputDataFormats’, ‘CTB’, …
‘Plots’, ‘training-progress’, …
‘Metrics’, ‘rmse’, …
‘Verbose’, 0 …
‘Validation);
% Train the network
net = trainnet(XTrain,YTrain,net,"mse",options)
I have built my model’s network architecture stored in "net", but I am unsure of how to incorporte "leave out one trial" validation during training and then test my model’s performance. I want the model to pull out one trial at a time and then train the model and continue to do this for all 10 trials so that I end up with one final network trained and validated on all the trials. But I also want to have data to test the model’s performance? Do I need to create a loop for this? or is there a way I can specify this in the training options? Any help would be greatly appreciated! Hello there I am trying to train a ML model with leave-out-one trial cross validation. Right now I have input data stored in the 1×10 cell array: "XTrain" with each cell containing the prediction inputs for all 10 trials and another 1×10 cell array: "YTrain" that contains the correposding continous variable we are trying to predict/output.
net = connectLayers(net,outputName,"fc");
% Specify training options
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 60, …
‘MiniBatchSize’, 1, …
‘SequenceLength’, ‘longest’, …
‘InputDataFormats’, ‘CTB’, …
‘Plots’, ‘training-progress’, …
‘Metrics’, ‘rmse’, …
‘Verbose’, 0 …
‘Validation);
% Train the network
net = trainnet(XTrain,YTrain,net,"mse",options)
I have built my model’s network architecture stored in "net", but I am unsure of how to incorporte "leave out one trial" validation during training and then test my model’s performance. I want the model to pull out one trial at a time and then train the model and continue to do this for all 10 trials so that I end up with one final network trained and validated on all the trials. But I also want to have data to test the model’s performance? Do I need to create a loop for this? or is there a way I can specify this in the training options? Any help would be greatly appreciated! machine learning, validation, neural network, trainnet MATLAB Answers — New Questions