May 2020
Intermediate to advanced
530 pages
17h 8m
English
The Dlib library provides functionality for feature standardization with the Dlib::vector_normalizer class. There is one limitation for using this class—we cannot use it with one big matrix containing all training samples. Alternatively, we should represent each sample with a separate vector object and put them into the C++ std::vector container, as follows:
std::vector<matrix<double>> samples;...vector_normalizer<matrix<double>> normalizer;samples normalizer.train(samples);samples = normalizer(samples);
We see that the object of this class can be reused, but it should be trained at first. The train method implementation can look like this:
matrix<double> m(mean(mat(samples)));matrix<double> sd(reciprocal(stddev(mat(samples)))); ...
Read now
Unlock full access