1

I want to create a neural network with tensorflow js just for learning purposes. It should determine if the input is odd or even and I think that can not be achieved with sigmoid or linear activations.

Is there a sin or cos function which is available in tf or if not, how to create a custom activation function?

  • create a NN for finding if a number is odd or even....why not! what you put as an input? here is the list of activation: https://www.tensorflow.org/api_docs/python/tf/keras/activations and here (in python tho) is a way to create your own activations https://stackoverflow.com/questions/39921607/how-to-make-a-custom-activation-function-with-only-python-in-tensorflow – Frayal May 15 '19 at 08:59
  • Just a note: If your input is binary then your output should be the least significant bit. No need for an activation function. – SaiBot May 15 '19 at 09:02
  • Hello. Supun. what is output? An activation function is decided by an aim of your model. – yaho cho May 15 '19 at 11:25
  • Alexis my input is an integer. Training with a one d array of ints and ys are an array of 0s and 1s, indicating if odd or even... – supun manathunga May 15 '19 at 11:30
  • so you have a single neuron in entrance... You might want to take another example for learning purposes – Frayal May 16 '19 at 10:10
  • Do you think that it is imposible to do this with a simple NN? – supun manathunga May 16 '19 at 11:54
  • 1
    What about %2 as a classifier? :) – Ahmad Moussa May 16 '19 at 17:33

0 Answers0