[英]What is the memory layout of the weights and bias of dnn module?
我想知道dnn模塊的內存布局,因此我可以將權重移植到另一個庫。
我可以按以下方式訪問權重和偏見
cv::Mat weight = input_net.getParam(input_layer_name.c_str(), 0);
cv::Mat bias = input_net.getParam(input_layer_name.c_str(), 1);
如果我有一個帶3個輸入過濾器,64個輸出過濾器和3x3內核的卷積層,那么內存布局將如何? 如果是卷積層,則應具有3 * 3 * 3 * 64權重和64偏差。 我如何知道每個重量和偏差在重量和偏差矩陣中的位置?
更確切地說,我如何訪問圖中的重量(A,C,N)?
它具有W x H x InCh x OutCh
布局。 從最低到最高的索引。 就像是:
w[0]: (x1, y1, inc1, outc1)
w[1]: (x2, y1, inc1, outc1)
...
w[n-1]: (xn, y1, inc1, outc1)
w[n]: (x1, y2, inc1, outc1)
w[n+1]: (x2, y2, inc1, outc1)
...
並進一步。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.