I originally asked this question on the Julia slack, but it occurred to me that this could be a better place to ask:
I’ve used Flux successfully for regression and multi-label classification in the past, but today I got stuck on a very simple binary classification problem. I naively assumed that this would be a simple matter of starting with a multi-label classification (using model-zoo/mlp.jl at master · FluxML/model-zoo · GitHub as a starting point), removing one-hot encoding of labels, reducing the number of outputs from the final layer to 1, and replacing logitcrossentropy
with Flux.Losses.logitbinarycrossentropy
as my loss function. This turned out not to work. My model refused to learn at all.
I made this gist where I have tried to modify the above example from the Flux model zoo to do a binary classification (guessing whether a MNIST image is a 0 or not):
It is still not working. What am I doing wrong here?