BERT:how to change the output feature?
이전 댓글 표시
When I use the bert to extract features,the output features are always 768 dimension.How can I change them into 300 dimension?
댓글 수: 9
Rik
2022년 9월 19일
That is a form of down-sampling. How do you propose to perform this downsampling?
Also, this question doesn't have anything to do with Matlab yet. You could indeed perform this downsampling in Matlab, but the concept itself is a deep learning question, not a Matlab question.
David Willingham
2022년 9월 19일
이동: Rik
2022년 9월 20일
Can you explain why you would like to change the output to 300?
XT
2022년 9월 20일
Rik
2022년 9월 20일
A fully connected layer is equivalent to doing a matrix multiplication. In your case you want a matrix of 768x300.
But there is a more fundamental problem. You say you want to analyze protein sequences. BERT is intended for normal text. Why do you think this will work in the first place?
XT
2022년 9월 20일
Rik
2022년 9월 20일
Well, if it works it works, that's up to you. I already gave you what you need to know: a fully connected layer is equivalent to doing a matrix multiplication. You can even do the training fully inside Matlab with the mldivide, \ function.
David Willingham
2022년 9월 20일
Hi Rik,
I spoke with development on this, they state:
==
Reducing the features of BERT might not help and wouldn’t recommend doing that in that situation.
It seems that they are trying to extract features of protein sequence from BERT, which is something BERT is not trained for.
==
I note that you have tried Bert already. Are you able to provide some example code? This may help us provide more guidence on this.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Modeling and Prediction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!