Machine-Learning Error: Message=The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc

Machine-Learning Error: Message=The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc.

  Source=Microsoft.ML.StandardTrainers


Please Login to see the rest of the answer

Answer: If you are using OnlineGradientDescent Machine Learning Algorithm to train your Model, chances are that you have Featurized one of your Feature column in the dataset. What happened was that, after featurizing one of the columns in the IDataView backet, the feature column became bigger hence adding more overhead to the algorithm given it's initial Learning Rate of 0.1.

- Find the OnlineGradientDescent algorithm and fine tune it's learning rate from 0.1 to 0.001f. See the code below:

.Append(mlContext.Regression.Trainers.OnlineGradientDescent(labelColumnName: "yourColumnName", featureColumnName: "Features",learningRate: 0.001f,numberOfIterations: 10));

//You might get away with reducing numberOfIterations as well.

 

 


Write an Article
#Machine-Learning #programming tools Machine-Learning published
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy