function x = normalize(x, mu, sigma)
x = bsxfun(@minus, x, mu);
x = bsxfun(@rdivide, x, sigma);
end

这里归一化使用的函数为:

x′=x−μσ
<script type="math/tex; mode=display" id="MathJax-Element-1"> x'=\frac{x-\mu}{\sigma} </script>

还可根据具体问题,使用特定的归一化函数:

  • (1)web’s law normalization:

    x←x⋅log(1+∥x∥2/0.03)∥x∥2
    <script type="math/tex; mode=display" id="MathJax-Element-2"> x\leftarrow x\cdot \frac{\log\left(1+\|x\|_2/0.03\right)}{\|x\|_2} </script>
  • (2)unit norm normalization:

    x←x∥x∥2
    <script type="math/tex; mode=display" id="MathJax-Element-3"> x\leftarrow \frac{x}{\|x\|_2} </script>
  • (3)no normalization

更多推荐