yolo v2网络中使用的优化程序是什么?

时间:2018-09-05 06:14:32

标签: optimization deep-learning conv-neural-network yolo darknet

我正在测试Darknet YOLO v2网络。在源代码中,有一个选项可以在cfg文件中使用Adam Optimizer。但是,我没有使用亚当。我想知道YOLO网络在不使用Adam时使用的优​​化器是什么?我找到了执行优化的部分,但我不知道此优化的类型(名称)。以下是YOLO v2代码中的该部分。

void update_convolutional_layer_gpu(layer l, update_args a)
{
float learning_rate = a.learning_rate*l.learning_rate_scale;
float momentum = a.momentum;
float decay = a.decay;
int batch = a.batch;

int size = l.size*l.size*l.c*l.n;

if(a.adam){
    adam_update_gpu(l.weights_gpu, l.weight_updates_gpu, l.m_gpu, l.v_gpu, a.B1, a.B2, a.eps, decay, learning_rate, size, batch, a.t);
    adam_update_gpu(l.biases_gpu, l.bias_updates_gpu, l.bias_m_gpu, l.bias_v_gpu, a.B1, a.B2, a.eps, decay, learning_rate, l.n, batch, a.t);
    if(l.scales_gpu){
        adam_update_gpu(l.scales_gpu, l.scale_updates_gpu, l.scale_m_gpu, l.scale_v_gpu, a.B1, a.B2, a.eps, decay, learning_rate, l.n, batch, a.t);
    }
}else{
    axpy_gpu(size, -decay*batch, l.weights_gpu, 1, l.weight_updates_gpu, 1);
    axpy_gpu(size, learning_rate/batch, l.weight_updates_gpu, 1, l.weights_gpu, 1);
    scal_gpu(size, momentum, l.weight_updates_gpu, 1);

    axpy_gpu(l.n, learning_rate/batch, l.bias_updates_gpu, 1, l.biases_gpu, 1);
    scal_gpu(l.n, momentum, l.bias_updates_gpu, 1);

    if(l.scales_gpu){
        axpy_gpu(l.n, learning_rate/batch, l.scale_updates_gpu, 1, l.scales_gpu, 1);
        scal_gpu(l.n, momentum, l.scale_updates_gpu, 1);
    }
  }
}

0 个答案:

没有答案