I have made a LSTM network (hidden size 16) where I give a sequence of 10 numbers as the input and feed its output to a fully connected layer.
The numbers in the sequence are corresponding to the words in the dictionary that I created (Eg: number 12 in the sequence corresponds to the 12th word in the dictionary)
What I want is to predict the next number (which is the next word) using that fully connected layer and I'm stuck at that place.
One method I tried is to create the FC layer with one neuron in the output with relu
activation and cast it's output a to integer
and get the word corresponding to that number. It's accuracy is too low.
Another method that came into my mind is to create FC with multiple outputs and connect it to a softmax
layer. Then get its output and convert the output to a binary number as probability < 0.5 as binary 0 and others binary 1. And then get the corresponding word. I haven't tried this method yet.
What I want to ask is whether there is a better way to do this..? What is the general solution for these kind of problems..? (A different architecture may be)