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

Question regarding discrete model prediction layer activation function and model loss function #121

Open
ericparakal opened this issue Sep 10, 2021 · 0 comments

Comments

@ericparakal
Copy link

ericparakal commented Sep 10, 2021

For the case of the discrete model, specifically the model definition in the file kdd99_model.py; why is the prediction layer activation function sigmoid and not softmax as the KDD99 problem is a multi-class classification problem?

pred = tf.keras.layers.Dense(n_labels, activation='sigmoid')(net)

Also, why is the from_logits parameter set to True in the SparseCategoricalCrossentropy loss function, if the prediction layer of the model already has a sigmoid activation function?

model_full.compile(loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), \
metrics=['accuracy'],
optimizer='adam')

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

1 participant