This question might be very specific application related but I was blocked and I thought this is a good place to ask. Let's say we have an LSTM in Keras that is sequence to sequence, for example Part of Speech Tagger. The last layer gives me, sequence of labels with the probability of each label. Consider the following predicted output;
A = [[0.1, 0.3, 0.2, 0.4],[0.2, 0.2, 0.2, 0.4],[0.5, 0.2, 0.1, 0.1]]
Basically this is a sequence of length 3 that has 4 possible tags at each time point of the sequence.
Now what I would like to do is change this sequence into following.
A' = [[0, 0, 0, 1],[0, 0, 0, 1],[1, 0, 0, 0]]
In other words, I want to put one at the location of the maximum probability and change all other ones to 0. Helps are very appreciated.