OK, I have to ask: Why would you ever try to train an RNN to count the number of 1’s in a binary string? I actually don’t think this is a suitable task for a neural network. For once, your output is not bounded.
Apart from that, why do you have an embedding layer? Your inputs are already numeric values. Embeddings are mainly needed to map words to meaningful vector representations for NLP tasks.