abhishek jha
abhishek jha

Reputation: 1095

Difference between tf.layers.conv1d vs tf.layers.conv2d

What is the difference in the functionalities of tf.layers.conv1d and tf.layers.conv2d in tensorflow and how to decide which one to choose?

Upvotes: 2

Views: 7516

Answers (1)

patapouf_ai
patapouf_ai

Reputation: 18693

tf.layers.conv1d is used when you slide your convolution kernels along 1 dimensions (i.e. you reuse the same weights, sliding them along 1 dimensions), whereas tf.layers.conv2d is used when you slide your convolution kernels along 2 dimensions (i.e. you reuse the same weights, sliding them along 2 dimensions).

So the typical use case for tf.layers.conv2d is if you have a 2D image. And possible use-cases for tf.layers.conv1d are, for example:

  • Convolutions in Time
  • Convolutions on Piano notes

Upvotes: 9

Related Questions