-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
labels = (np.arange(num_labels) == labels[:,None]).astype(np.float32) error boolean #7
Comments
It is a way to one-hot-encode the labels. If you break it down, you take the number of labels through a numpy array as such: Say you have two numpy arrays with the labels and target_vectors. Now, target_vector[:,None] returns the array [[2],[0],[1]], which is a column vector. If we Now, the last part, astype(np.float32) simply makes these boolean outputs into integers 0 or 1. |
can you explain what does it mean?
The text was updated successfully, but these errors were encountered: