使用keras的backend对input进行conv1d

from keras import backend as K
a=K.variable(K.random_normal(shape=(5,10,40)))
w=K.variable(K.truncated_normal(shape=(3,40,128)))
conv_layer_3=K.conv1d(a,w,data_format='channels_last')
K.conv1d(x,kernel,strides=1,padding='valid',data_format=None,dilation_rate=1)#下面是以data_format='channels_last'的状态来给x,kernel赋值的
x: input tensor #形如(batch_size,input_length,embedding_dim)
kernel: kernel(filter) tensor #形如(output_channels,filter_rows,filter_columns)
stride: 表每次窗口滑动的步长
padding: 填充方式

你可能感兴趣的:(keras,backend,tensorflow)