Multi-to-One Configuration in LSTM Using CNTK

I want to have a many-to-one option in LSTM using CNTK, i.e. each word in a sentence is an input, and a label on a sentence is an output. Therefore, it is a mapping from many inputs to one output. However, the example provided in the CNTK Github repository is many-to-many. I am having trouble understanding the input format change that needs to be done for my application. In the above example, each word in a sentence has a label associated with it, while in my application I want to have a label for the sentence.

Would it be right to assign the label of the sentence that I have to all the words in this sentence? Is there a better alternative approach?

+4
source share
1 answer

This page shows how to accept lstm outputs and compute a trained convex combination of them (also known as attention).

Update . Regarding the input format, you can do it in different ways. If you use the built-in reader, you can put the label in the first element of the sequence, as in this example . If you are loading data from Python, this other thread matters.

+2
source

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


All Articles