tensorflow2学习(一):Conv1D

方树
2023-12-01

Conv1D的输入输出:

import tensorflow as tf
from tensorflow.keras import layers

con1 = layers.Conv1D(1, kernel_size=1, padding='same', activation=tf.nn.relu, input_shape=(2, 2))
model = tf.keras.Sequential()
model.add(con1)
print(model.input_shape)
print(model.output_shape) 

'''
(None, 2, 2)
(None, 2, 1)
'''

参考:Python keras.layers 模块,Conv1D() 实例源码

 类似资料: