I am new to PyTorch. I have a doubt about converting a data frame with 6 columns and 50,000 rows. I want to form 6 channels with these 6 columns and 100 rows such that it can be given as input to a CNN that takes input with 6 channels. Could any of you please help me to sort this out?
I assume you would want your data sample to be of the shape -
[batch, 6, 100]
So Initialize a NumPy array of that shape
data = numpy.zeros((1, 6, 100)) #batch size equal to 1
and then populate this NumPy array the way you want.
Then convert this Numpy array to a torch tensor using -
torch_tensor = torch.from_numpy(data)
if you want to batch it, you could stack these tensors on top of each other at the
0th dimension making the input of shape
batch_size, 6, 100