Hi All,
Is there anyone know how to write transforms for non-image data to adapt the existing deep neural network such as AlexNet, VGG, etc?
The detail is like this:
suppose my data has a form of 3x60x64 after processing,
the 3 channel is not RGB but XYZ so they have different range each other(e.g. X~[ - 10.1, +10.8 ], Y~[ 1.3, 50.7 ], Z~[ - 8.2, + 9.5 ]),
The NN requires an input with 3x224x244 dim and [ 0, 1 ] range. so
- I want to resize my input from 60x64 to 224x224.
- Since XYZ maybe have some correlation so I don’t want to normalize all of them to [ 0, 1 ], it’s better to keep the original value (Is this make sense?)
I write a transform like this but it doesn’t work (of course it’s not an image)
transform = transforms.Compose(
[
transforms.ToPILImage(),
transforms.Resize((227, 227)),
transforms.ToTensor()
]
)
then I change it to this:
transform = transforms.Compose(
[
transforms.Lambda(lambda x: np.resize(x, (3, 224,224))),
]
)
I don’t know whether it works since my computer is still frozen! I doubt it because I know nothing about the inner principle of np.resize, it might have a better way to tackle data like this.