Let's say my inputs are, A and B. The inputs are roughly like this, A = [10, 5, 30, 2] which can have arbitrary values in the range [1,100] and B = [0, 1, 0, 0] which is an one hot vector. The expected output, C, is = [5], which is the dot product of the two input vectors, C = A.B
Similarly, for A = [10, 5, 30, 2] and B = [0, 0, 1, 0], the output will be C = [30].
Essentially, I want the neural network to act as a 4-way multiplexer (https://en.wikipedia.org/wiki/Multiplexer).
I have implemented a neural network with two hidden layers. While it works on training data, it fails to generalize beyond that.
Is there an underlying reason that this problem will be difficult for a Neural Network?