Retrieving Layer Activations from bertDocumentClassifier (Text Analytics Tooblx)
Afficher commentaires plus anciens
Hi,
started using the text analytics toolbox, and successfully trained a bertDocmentClassifier network on my dataset.
In the past I've used the 'activations' function successfully to extract layer activations from dlNetworks.
However, for a bertDocmentClassifier, I cannot get the activations function to work, as it is not like e.g. image DL network objects - it has a tokenizer first.
So for example out=activations(bertTrained,textstring,layername) does not work
I tried to apply the tokenizer first, as in e.g.:
[a,b]=encode(mdl.Tokenizer,textDataTrain(1,:))
and that gives the token codes and segments fine in a,b.
But how do i "feed" those to the dlNetwork itself from the bertDocumentClassifer object?
This for example does NOT work:
net=mdl.Network;
activations(net,a,b,'out_fc2')
and variations fail as well.
So to sum up - I have a trained BERT classifier object, I can use it to classify just fine, but I can't get the network's layer activations.
Thanks!
Réponse acceptée
Plus de réponses (1)
tsvi lev
le 30 Mar 2024
1 vote
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!

