1

I have understood from this post that we need to normalize the training features and scale the test/validation features with the training data.

My training samples have fixed dimension but the dimensions of validation and test data are variable. I can apply zero mean unit variance for training data but how do I normalize the validation/test data samples?

cottontail
  • 312
  • 3
  • 4
  • 13

2 Answers2

0

The easiest way is to pad your data into the same length. For example make all training, validation, & test subjects into the same length by adding 0 at the end or beginning of each subject, then your problem should be solved. You can refer to the following keras example for a better idea.

Understanding masking and padding

cottontail
  • 312
  • 3
  • 4
  • 13
DaCard
  • 126
  • 6
0

That is a common case on image and audio processing, you need to find a way in which dimensions stay the same, such as normalizing per channel.

If you have a 1D vector of features, taking mean and variance of all variables will end up normalizing it in a way, it works in Computer Vision like a charm. It is also a way to reduce the space cost of your normalizing algorithm.

Pedro Henrique Monforte
  • 1,682
  • 1
  • 13
  • 26