autocorrelation of the input in tensorflow/keras

后端 未结 3 598
花落未央
花落未央 2021-01-22 12:43

I have a 1D input signal. I want to compute autocorrelation as the part of the neural net for further use inside the network. I need to perform convolution of input with input i

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-22 12:51

    You can just use tf.nn.conv3d by treating the "batch size" as "depth":

    # treat the batch size as depth.
    data = tf.reshape(input_data, [1, batch, in_height, in_width, in_channels])
    kernel = [filter_depth, filter_height, filter_width, in_channels, out_channels]
    out = tf.nn.conv3d(data, kernel, [1,1,1,1,1], padding='SAME')
    

提交回复
热议问题