ok1zjf / VASNet

PyTorch implementation of the ACCV 2018-AIU2018 paper Video Summarization with Attention
MIT License
180 stars 48 forks source link

please explain the following code part of adding x and y #18

Open VinACE opened 3 years ago

VinACE commented 3 years ago

please explain the following code part of adding x and y vasnet_model.py class VASNet(nn.Module): ..... def forward(self, x, seq_len):

    m = x.shape[2] # Feature size

    # Place the video frames to the batch dimension to allow for batch arithm. operations.
    # Assumes input batch size = 1.
    x = x.view(-1, m)
    y, att_weights_ = self.att(x)

    y = y + x # -- what is the reason behind this step please explain,
Pager07 commented 3 years ago

residual link. It's in the diagram. Please read the paper