Why would you ever try to train an RNN to count the number of 1’s in a binary string?
I am doing this for my own learning. In theory rnn should be able to do this task. It is not impossible to do this.
Apart from that, why do you have an embedding layer?
I have an embedding layer (which I think will not deteriorate the performance) because once I am successful in this task, I plan to make a “A” counter or any other alphabet/character counter. I know we can make counters just by regex, but rnn should also be able to do this. I was able to make a rnn which counted “1” if I sent the string one-by-one (hidden state has the count till now, input is the next value 1/0 and output is either count+1 or count) . But that is an easy task for rnn, just take decision either to add or not to add. I wanted to make a rnn which carries the count in its hidden state.
In case you have any suggestion/solution, it would be of great help.