필터 지우기
필터 지우기

LSTM padding and masking

조회 수: 29 (최근 30일)
Ao Du
Ao Du 2020년 12월 10일
답변: Haijun Ruan 2021년 7월 21일
I am solving a sequence-to-sequence classification problem based on LSTM using Matlab 2020b. The sequences have varaible length so padding within each minibatch is needed. However, I am not sure if Matlab automatically do the masking when calculating the crossentroy loss as well as the training/validation accuracy. From the training plot, the reported accuracy (around 70%) is much lower than those manually calculated by using checkpoints (where I get around 90% accuracy). I suspect although Matlab 2020b supports sequence padding and validation data in LSTM, it still did not offer the option of masking to reduce the influence caused by padding. Any insights?

답변 (2개)

Aditya Patil
Aditya Patil 2020년 12월 22일
Currently, masking is not supported in MATLAB. I have brought the request to the notice of concerned people.
As a workaround, you can sort the inputs so that the amount of padding required is minimized. You may also set the minibatch size to 1, so that no padding is required.
  댓글 수: 1
Yildirim Kocoglu
Yildirim Kocoglu 2021년 1월 16일
Thank you! I was really curious about this as well since it can be done in python. I really hope they can add this feature.

댓글을 달려면 로그인하십시오.


Haijun Ruan
Haijun Ruan 2021년 7월 21일
I am wondering whether masking is supported in MATLAB now.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by