简体   繁体   English

如何加速 RPN 或 SSD 神经元网络的训练

[英]how to accelerate the training of RPN or SSD neuron network

We know that in SSD, there are three output feature maps.我们知道,在 SSD 中,有三个 output 特征图。 During training, I have to caculate the loss between the output of the SDD and the ground truth every pixel.在训练过程中,我必须计算 SDD 的 output 和 ground truth 每个像素之间的损失。 So how can I complete this "from pixel to pixel operation" quickly?那么如何才能快速完成这个“从像素到像素的运算”呢? Now I use the nested for loop to complete the caculation of loss, but it is extremely slow.现在我使用嵌套的for循环来完成loss的计算,但是速度极慢。 Say another example, there is an output map indicating the probability whether there is an object or not, say the size is 100×100, and I set the threshould 0.5.再举一个例子,有一个output map 表示是否有一个object的概率,说大小是100×100,我设置第5个。 So how can I know which pixel of the output map has a value above 0.5?那我怎么知道output map的哪个像素值大于0.5呢? Now I use the for loop, like for i in range(100): for y in range(100): if map[i][y]>0.5 do something ,it is too slow?现在我使用 for 循环,比如for i in range(100): for y in range(100): if map[i][y]>0.5 do something ,太慢了? So how can I solve it?那么我该如何解决呢?

Given the information in your question, you could use the numpy library to work with numpy.ndarray , you would then be able to perform a wide range of element-wise operations without the need for loops.鉴于您问题中的信息,您可以使用numpy库与numpy.ndarray一起使用,然后您将能够执行各种元素操作而无需循环。

For instance, with map a 2d numpy.ndarray , map > 0.5 returns a boolean array of the same size as map , indicating which elements are greater than 0.5. For instance, with map a 2d numpy.ndarray , map > 0.5 returns a boolean array of the same size as map , indicating which elements are greater than 0.5. You could then use this to perform your computations only with the relevant elements.然后,您可以使用它仅使用相关元素执行计算。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在神经网络中使用 3 个神经元? - How To Use 3 Neuron in Neural Network? 在张量流中,如何在不实际训练的情况下评估神经元网 - In tensorflow, how to evaluate a Neuron Net without actually training it 如何在训练 SSD 后预测 Precision、Recall 和 F1 分数 - How to predict Precision, Recall and F1 score after training SSD 用scipy.minimize()训练逻辑神经元 - training a logistic neuron with scipy.minimize() 线性分类器 Tensorflow2 未训练(1 个神经元模型) - Linear Classifier Tensorflow2 not training(1 neuron model) 在神经网络中获得“神经元边缘神经元”值的有效方法 - Efficient way to get "neuron-edge-neuron" values in a neural network 如何在tensorflow中为ssd网络加载和保存Widerface数据集? - How to load and save Widerface dataset for ssd network in tensorflow? 如何在 NEURON 中创建突触? - How to create a synapse in NEURON? 如何控制输入特征是否仅对 Tensorflow 神经网络后续层中的一个神经元有贡献? - How to control if input features contribute exclusively to one neuron in subsequent layer of a Tensorflow neural network? 神经网络模型如何为单层中的每个神经元学习不同的权重? - How do neural network models learn different weights for each of the neuron in a single layer?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM