BERT:how to change the output feature?
Afficher commentaires plus anciens
When I use the bert to extract features,the output features are always 768 dimension.How can I change them into 300 dimension?
9 commentaires
Rik
le 19 Sep 2022
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
le 19 Sep 2022
Déplacé(e) : Rik
le 20 Sep 2022
Can you explain why you would like to change the output to 300?
XT
le 20 Sep 2022
Rik
le 20 Sep 2022
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
le 20 Sep 2022
Rik
le 20 Sep 2022
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
le 20 Sep 2022
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.
Réponses (0)
Catégories
En savoir plus sur Modeling and Prediction dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!