Retrieving Layer Activations from bertDocumentClassifier (Text Analytics Tooblx)
이전 댓글 표시
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!
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Modeling and Prediction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

