gpt4 book ai didi

tensorflow - 我们在YOLO的输出层使用哪个激活函数?

转载 作者:行者123 更新时间:2023-12-03 21:01:13 25 4
gpt4 key购买 nike

我在 Keras 中构建了一个简单的 YOLO 本地化模型,例如,

model_layers = [
keras.layers.Conv2D( 32 , input_shape=( input_dim , input_dim , 3 ) , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 32 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.MaxPooling2D( pool_size=( 2 , 2 ) , strides=2 ),
keras.layers.Conv2D( 64 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 64 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.MaxPooling2D( pool_size=( 2 , 2 ) , strides=2 ),
keras.layers.Conv2D( 64 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 64 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.MaxPooling2D( pool_size=( 2 , 2 ) , strides=2 ),
keras.layers.Conv2D( 128 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 128 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 64 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 64 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 32 , kernel_size=( 3 , 3 ) , strides=1 , activation='relu' ),
keras.layers.Conv2D( 8 , kernel_size=( 3 , 3 ) , strides=1 ),
]

model = keras.models.Sequential( model_layers )
model.compile( loss=yolo_keras_loss , optimizer=keras.optimizers.Adam( lr=0.0001 ) )
model.summary()

正如所观察到的,最后一层的激活函数是“线性的”。

But with regards to YOLO's output, all the values ( confidence score, bounding box coordinates and class probabilities ) are normalized. So should I use a sigmoid activation function or a linear activation function?



我在任何有关 YOLO 的资源中都找不到输出层的激活函数。

最佳答案

如果您引用 original paper ,他们对最后一层使用线性激活。在“2.2. 培训”部分,您可以找到:

We use a linear activation function for the final layer andall other layers use the following leaky rectified linear activation...

关于tensorflow - 我们在YOLO的输出层使用哪个激活函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57443049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com