CoreML - access penultimate network layer output?

I have a working CoreML app which loads the InceptionV3 mlmodel supplied by Apple on the Machine Learning page. (https://developer.apple.com/machine-learning/)


I am able to successfully run inference on pixel buffers, however, I am curious if it is possble to introspect the penultimate layer of the neural networks output for a inference operation to get a feature vector of weights - these weights are quite useful for doing similarity metrics.


Looking at the Vision and CoreML documentation it does not appear that one can introspect a model for this information - and looking deeper at BNN in accelerate.framework, it appears there is a BNNSVectorDescriptor - however I see no way to climb down from CoreML or Vision to the underlying accelerate operations.


Does one have to edit a model to explicely mark multiple outputs? If so, how can one edit an existing mlmodel? The file format docs are not particularly insightful (to me).


Thank you!

Replies

This is a better place to ask this question but it's a little quiet...


https://forums.developer.apple.com/community/system-frameworks/machine-learning

Thanks! I posted there. Appreciate it.