[英]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.