0

I'm trying to recreate this architecture.
enter image description here

The model has embeddings and LSTM layer followed by pooling layer.

I'm stuck on how to pool multiple LSTM outputs. (not pooling time sequence).

for example, if the LSTM input sequences are:

Start1 - A - B - C - End1
Start1 - C - D - E - End1

I want this 2 sequence LSTM-outputs to be pooled first (as prediction output (max or avg)) before the LSTM take the learning step.
(Pooled because they have the same start and end).

I expect something like this:

input_layer = Input()
x = Embedding()(input_layer)
x = LSTM()(x)
output = ConditionalPooling()(x)   

The question is how to implement the ConditionalPooling, where ConditionalPooling is a function to group sequences output which has the same head and tails.

Thank you :)

Jessin Ra
  • 63
  • 7
  • Can you provide information about the paper, for further explanation if what you want to do. Also, if you are looking for something like `if` statement care about the differentiabliness if your layer. – OSainz Jul 04 '19 at 05:52
  • @OSainz this is the [paper](https://arxiv.org/pdf/1811.04540.pdf), and this is the original [repository](https://github.com/eBay/KPRN) – Jessin Ra Jul 05 '19 at 06:34

0 Answers0