How to use maximum aggregation to collect information from LSTM nodes

gru_out = Bidirectional(GRU(hiddenlayer_num, return_sequences=True))(embedded)
#Tensor("concat_v2_8:0", shape=(?, ?, 256), dtype=float32)

I use Keras to create a GRU model. I want to collect information from all the vectors of a GRU model node instead of the last node. For example, I need to get the maximum value of each vector, as well as the description of the image, but I don’t know how to do it.  enter image description here

+4
source share
1 answer

You can use the GlobalMaxPooling1Done described here:

gru_out = Bidirectional(GRU(hiddenlayer_num, return_sequences=True))(embedded)
max_pooled = GlobalMaxPooling1D(gru_out)
+2
source

Source: https://habr.com/ru/post/1672671/


All Articles