In Programming Assignment: Transfer Learning with MobileNet at Exercise 2 - alpaca_model
when I use sigmoid as activation function does not pass test when I use linear as activation function it is pass why?
I think in binary classification should use sigmoid.
Please pay attention to the logits flag in the loss function:
loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
When logits is True
, softmax is not required as the output activation function. See this as well.
1 Like
Right: the point is that the sigmoid
(or softmax
) is included, but it’s being handled internally by the loss function instead of explicitly in your code. Here’s a thread which explains why they do it that way.
1 Like