I have a feature that is boolean and I would like to feed it to a neural net as one of the inputs. I think in theory the best is to encode as false->0 and true->1 because 0 as an input will deactivate weights of a neuron. Is this correct?


Actually, it is not clear what you mean by deactivating but if it means the output of neuron would be zero, it is not correct due to having bias term, also known as intercept. Furthermore, we usually use normalisation for features which are of different scales. Your boolean values do not have a large range. You don't need to scale them. If I want to be more precise, you may need depending on the other features' range, because they may change slightly among different input patterns and vary less than let say 1e-5 for different samples, but most of the time, booleans are not needed to be scaled.

| improve this answer | |
  • $\begingroup$ I understand the bias problem but I'm somewhat confused. Did you intend to say "but most of the time, booleans are not needed to be scaled."? Thank you! $\endgroup$ – Manngo May 28 '18 at 22:32
  • $\begingroup$ @Manngo Oops :) edited. $\endgroup$ – Media May 29 '18 at 0:37
  • $\begingroup$ Is normalizing inputs similar to turning a gray pic into a binary colored pic? $\endgroup$ – feynman Nov 11 '18 at 9:26
  • $\begingroup$ @feynman not really. I didn't understand the last part of your question but the first part is not correct. Gray to binary means you are loosing information but in some cases it is not very important you loose extra information. For instance, for ocr tasks, gray-level images are more preferable than coloured due to a smaller number of calculations. $\endgroup$ – Media Nov 12 '18 at 20:13

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.