Input to 1D cnn when input is skeleton data

Hi,

as input data I am using 20 npz files. Each npz file contains 64 rows with 51 data points.

I want to implement 1D CNN, but I am getting confused what should in_channels be in my case:

layer1 = torch.nn.Conv1d(in_channels, out_channels = 32, kernel_size = 3)

Can someone give me tip here? Thanks!

The expected input to nn.Conv1d is a 3D tensor in the shape [batch_size, in_channels, seq_len].
Your loaded data should thus already define the in_channels size. If it’s not in the right format yet, you could unsqueeze the channel dimension and set in_channels to 1.