I plan to create a neural network using Python, Keras and TensorFlow. All the tutorials I have seen so far are concerned with image recognition. However, the goal of my program would be to take in 10+ inputs and calculate a binary output (true/false) instead. What would you suggest me to learn for this specific purpose?

  • $\begingroup$ Hi and welcome to this community! I've edited your post to make it clearer, but I might have changed your original intent. If that's so, please, re-edit your question again. $\endgroup$
    – nbro
    Jul 8 '19 at 10:09
  • $\begingroup$ Thank you @nbro! Actually I might add: I need dual input (a separate channel for both true and false ) because I might take their difference and individual values into consideration before making a final decision. $\endgroup$
    – IUBIU
    Jul 8 '19 at 10:25
  • $\begingroup$ Maybe you're looking for softmax, but I'm not sure. I don't understand what you mean by "I need dual input (a separate channel for both true and false)", given that in your question you say that you will have more than 10 inputs. Can you please clarify this? $\endgroup$
    – nbro
    Jul 8 '19 at 10:28
  • $\begingroup$ Dual output, sorry. I meant to write output. $\endgroup$
    – IUBIU
    Jul 8 '19 at 10:31
  • 1
    $\begingroup$ You don't need dual output you can have 1 output that represents probability of being true, and probability of being false would be $1 - p(true)$ $\endgroup$
    – Brale
    Jul 8 '19 at 10:55

There are several loss functions that you can use for binary classification. For example, you could use the binary cross-entropy or the hinge loss functions. See, for example, the tutorials Binary Classification Tutorial with the Keras Deep Learning Library (2016) and How to Choose Loss Functions When Training Deep Learning Neural Networks (2019) by Jason Brownlee. Have also a look at Keras documentation of its available loss functions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.