mila-iqia / blocks-examples

Examples and scripts using Blocks
MIT License
147 stars 94 forks source link

sentence mask #76

Closed YilunLiu closed 8 years ago

YilunLiu commented 8 years ago

What is sentence mask used for in the program ? I see source sentence mask and target sentence mask. In the block documentation, it says the mask is (batch,) size and is 1 when data is available and 0 otherwise. When is the data not available ? Or are they any other use of the sentence mask?

sjtufs commented 8 years ago

@YilunLiu A batch is possibly made of sentences of different length, and shorter sentences are padded with EOS symbols. Data in those padded positions are not available thus marked by 0 in mask. You can see this by printing the source sentence (by adding source_sentence to TrainingDataMonitoring for example).

YilunLiu commented 8 years ago

Got it. Thanks!