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!

