Keras

1. tf.keras.layers.Conv2D

tf.keras.layers.Conv2D(
    filters, kernel_size, strides=(1, 1), padding='valid',
    data_format=None, dilation_rate=(1, 1), groups=1, activation=None,
    use_bias=True, kernel_initializer='glorot_uniform',
    bias_initializer='zeros', kernel_regularizer=None,
    bias_regularizer=None, activity_regularizer=None, kernel_constraint=None,
    bias_constraint=None, **kwargs
)
Arguments
filtersInteger, the dimensionality of the output space (i.e. the number of output filters in the convolution).
kernel_sizeAn integer or tuple/list of 2 integers, specifying the height and width of the 2D convolution window. Can be a single integer to specify the same value for all spatial dimensions.
stridesAn integer or tuple/list of 2 integers, specifying the strides of the convolution along the height and width. Can be a single integer to specify the same value for all spatial dimensions. Specifying any stride value != 1 is incompatible with specifying any value != 1. dilation_rate
paddingone of or (case-insensitive). means no padding. results in padding evenly to the left/right or up/down of the input such that output has the same height/width dimension as the input. “valid”“same”“valid”“same”
data_formatA string, one of (default) or . The ordering of the dimensions in the inputs. corresponds to inputs with shape while corresponds to inputs with shape . It defaults to the value found in your Keras config file at . If you never set it, then it will be . channels_lastchannels_firstchannels_last(batch_size, height, width, channels)channels_first(batch_size, channels,height, width)image_data_format~/.keras/keras.jsonchannels_last
dilation_ratean integer or tuple/list of 2 integers, specifying the dilation rate to use for dilated convolution. Can be a single integer to specify the same value for all spatial dimensions. Currently, specifying any value != 1 is incompatible with specifying any stride value != 1. dilation_rate
groupsA positive integer specifying the number of groups in which the input is split along the channel axis. Each group is convolved separately with filters. The output is the concatenation of all the results along the channel axis. Input channels and must both be divisible by . filters / groupsgroupsfiltersgroups
activationActivation function to use. If you don’t specify anything, no activation is applied (see keras.activations).
use_biasBoolean, whether the layer uses a bias vector.
kernel_initializerInitializer for the weights matrix (see keras.initializers). kernel
bias_initializerInitializer for the bias vector (see keras.initializers).
kernel_regularizerRegularizer function applied to the weights matrix (see keras.regularizers). kernel
bias_regularizerRegularizer function applied to the bias vector (see keras.regularizers).
activity_regularizerRegularizer function applied to the output of the layer (its “activation”) (see keras.regularizers).
kernel_constraintConstraint function applied to the kernel matrix (see keras.constraints).
bias_constraintConstraint function applied to the bias vector (see keras.constraints).

2. tf.keras.layers.Concatenate

tf.keras.layers.Concatenate(
    axis=-1, **kwargs
)
Arguments
axisAxis along which to concatenate.
**kwargsstandard layer keyword arguments.

Example

x = np.arange(20).reshape(2, 2, 5)
print(x)
y = np.arange(20, 30).reshape(2, 1, 5)
print(y)
tf.keras.layers.Concatenate(axis=1)([x, y])
x = np.arange(20).reshape(2, 2, 5)
print(x)
y = np.arange(20, 30).reshape(2, 1, 5)
print(y)
tf.keras.layers.Concatenate(axis=1)([x, y])
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值