Message Boards Message Boards

Using ValidationSet in NetTrain

Posted 23 days ago

Hi I am quite new to using Mathematica for machine learning purposes, hence this might be a basic question. In the following code I am using a trained neural network to output the rotation angle of a qubit (after training in for a set of discrete rotations). After training I send the training data through as a test. The output is as expected. The neural network runs, but I am interested in how to use the bulit-in ValidationSet function to avoid overfitting. My NetTrain function is of the following form:

trainedNet = NetTrain[net2, trainingData2, MaxTrainingRounds -> 70000]

Can anyone advise on a basic way to employ the ValidationSet built-in function for my example code. I left highlighted in purple (commented out) my attempt:

trainedNet = NetTrain[net, trainingData2, MaxTrainingRounds -> 70000, ValidationSet -> Scaled[.1]]

but I'm not sure if it is being employed in the correct way. Any advice on how to effectively use ValidationSet is most appreciated. Thanks for your time.

The code in question is as follows:

POSTED BY: Byron Alexander
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract