gpt4 book ai didi

deep-learning - Keras,如何在 Convolution2D 中定义填充?

转载 作者:行者123 更新时间:2023-12-01 00:35:24 28 4
gpt4 key购买 nike

Convolution2D docs of keras , 我发现没有关于 padding 定义的详细信息

keras.layers.convolutional.Convolution2D(nb_filter, 
nb_row,
nb_col,
init='glorot_uniform',
activation=None,
weights=None,
border_mode='valid',
subsample=(1, 1),
dim_ordering='default',
W_regularizer=None,
b_regularizer=None,
activity_regularizer=None,
W_constraint=None,
b_constraint=None,
bias=True)
subsample论点是

tuple of length 2. Factor by which to subsample output. Also called strides elsewhere.



我认为这是大步。

border_mode论点是

'valid', 'same' or 'full'. ('full' requires the Theano backend.)


validsame也是 TensorFlow 的 conv2d 函数中的参数。

如何定义padding,如何设置它的值?

最佳答案

您要的是ZeroPadding2D层,只需将其放在卷积层之前。这比将这个功能放在 Convolution2D 中更灵活。

关于deep-learning - Keras,如何在 Convolution2D 中定义填充?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41669233/

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