keras API: 一维卷积和二维卷积

it2026-08-27  5

keras官网https://keras.io/api/layers/

channel方向的计算规则?一维卷积核是一维还是二维?是二维,其中一维用户指定,另一维等于channel。二维卷积核是二维还是三维?是三维,其中两维用户指定,另一维等于channel。

Conv1D

输入:3D 张量 ,维度为 (batch_size, steps, channels)。输出:3D 张量,维度为 (batch_size, new_steps, filters)。 由于填充或窗口按步长滑动,steps 值可能已更改。卷积核:2D张量,维度为(kernel_size,channels)。

Conv2D

输入:4D 张量,维度为 (samples, rows, cols, channels)。输出:4D 张量,维度为 (samples, new_rows, new_cols, filters)。由于填充或窗口按步长滑动,rows和cols值可能已更改。卷积核:3D张量,维度为(kernel_size[0], kernel_size[1], channels)。

MaxPooling1D

输入:3D张量,维度为(batch_size, steps, features)。输出:3D张量,维度为(batch_size, downsampled_steps, features)。时间步方向的长度缩短了。pool_size=2为单个整数。

MaxPooling2D

输入:4D张量,维度为(batch_size, rows, cols, channels)。输出:4D张量,(batch_size, pooled_rows, pooled_cols, channels)。沿着图像行列方向的维度缩短。pool_size=(2, 2)为两个整数的元组。
最新回复(0)