Skip to content
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

Multi label classifier in RMDL. #28

Closed
abhilash42 opened this issue Jun 26, 2020 · 1 comment
Closed

Multi label classifier in RMDL. #28

abhilash42 opened this issue Jun 26, 2020 · 1 comment

Comments

@abhilash42
Copy link

Problem Statement
The problem I am solving is to classify genres of movies. So, the output in my case would be one-hot encoded for 20 genres(array of 20 elements with 1 or 0). For this we are using loss function of binary_crossentropy and sigmoid as the last layer activation.

Describe the solution you'd like
We would like to have an option of binary_crossentropy=True in parameters, and also number_of_classes should be configurable and not np.max(y_train)+1 which would always be 2 in my case.

Describe alternatives you've considered
No alternatives have been considered for now.

@kk7nc
Copy link
Owner

kk7nc commented Nov 12, 2020

Thank you for your question:
is there two option which are change "sparse_categorical=True" to sparse_categorical= False, and mack your output int as


import numpy as np
 a = np.array([[0,1,0,0],[1,0,0,0],[0,0,0,1]])
 [np.where(r==1)[0][0] for r in a]
[1, 0, 3]

@kk7nc kk7nc closed this as completed Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants