udacity / deep-learning-v2-pytorch

Projects and exercises for the latest Deep Learning ND program https://www.udacity.com/course/deep-learning-nanodegree--nd101
MIT License
5.26k stars 5.32k forks source link

Convert boolean features to float in training data #417

Open NotSkynet opened 1 year ago

NotSkynet commented 1 year ago

This commit addresses a type mismatch issue in the neural network training function. The one-hot encoded rank features in the training data were boolean values, which caused a UFuncTypeError when trying to perform operations with float values in the error term formula.

To fix this, we've added a line to convert all features in the training data to float. This converts the boolean rank features to numerical values (1.0 for True, 0.0 for False), which can be used in the error term formula without causing type errors.

We've also updated the markdown documentation to explain this conversion.