用 pycaffe 实现 leaky-layer relu

Implement leaky-layer relu with pycaffe

我正在使用 pycaffe 来创建我的网络,并且想使用泄漏层 relu 而不是普通层,我该如何将其放入函数参数中?

from caffe import layers als L, params as P
n.relu1 = L.Relu(n.conv1, in_place=True)

这是我当前的代码片段

您可以使用negative_slope参数:

n.relu1 = L.ReLU(n.conv1, in_place=True, relu_param={'negative_slope': 0.1})