Passing dlarrays to Alexnet
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear community,
As a part of training a custom DL model, I want to pass an 'image' to Alexnet and extract an intermediate layer's activation. The issue that I have is that the image is dlarray, i.e., a matrix with learnable parameters of my custom network - therefore, it needs to stay dlarray in order to be traceable. Alexnet is not accepting dlarrays, so activation(), predict() and forward() are useless here. Any advice on how to best approach this?
댓글 수: 0
답변 (1개)
Himanshu
2025년 1월 17일
Hello,
To pass a "dlarray" to AlexNet and extract intermediate activations, convert the "dlarray" using "extractdata", process it through AlexNet, and convert the output back if needed.
Deep learning array for customization: https://www.mathworks.com/help/deeplearning/ref/dlarray.html
Extract data from "dlarray": https://www.mathworks.com/help/deeplearning/ref/dlarray.extractdata.html
Alternatively, convert AlexNet to a "dlnetwork" using MATLAB's "dlnetwork" function, which accepts "dlarray" inputs directly. This allows you to extract activations using the "forward" method while maintaining parameter traceability.
Compute deep learning network output for training: https://www.mathworks.com/help/deeplearning/ref/dlnetwork.forward.html
I hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!