Skip to content

Doubt regarding MaskZero #433

@vguptai

Description

@vguptai

Hi,

I have variable length sequences and I am zero padding them and adding them to a batch. I am using LSTM decorated with a Sequencer to classify these sequences. I have two questions:

  1. Does it matter if I zero pad smaller sequences on LEFT or RIGHT? Following discussion How to use MaskZero with LSTM and nn.ClassNLLCriterion for variable length squences  #75 suggests left padding should be done. Is this correct?

  2. Does MaskZero skip all the zeros in the input while forward and backward or it only skips those zeros which are continuous and till the end of tensor. How does MakeZero differentiate whether zero in the input row is actual data or padding?

For ex. A sequence can look like this: 4, 5, 0, 5, 0, 0, 0

Will MaskZero process the zero at third location correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions