斯坦福CS231n课程作业# 1(代码笔记3)

k-Nearest Neighbor (kNN) exercise

Inline Question 2

We can also use other distance metrics such as L1 distance.
For pixel values \(p_{ij}^{(k)}\) at location \((i,j)\) of some image \(I_k\),

the mean \(\mu\) across all pixels over all images is \[\mu=\frac{1}{nhw}\sum_{k=1}^n\sum_{i=1}^{h}\sum_{j=1}^{w}p_{ij}^{(k)}\]
上面是待分类图片与所有训练集图片所有像素之间的L1距离的平均值。

And the pixel-wise mean \(\mu_{ij}\) across all images is
\[\mu_{ij}=\frac{1}{n}\sum_{k=1}^np_{ij}^{(k)}.\]
The general standard deviation \(\sigma\) and pixel-wise standard deviation \(\sigma_{ij}\) is defined similarly.

Which of the following preprocessing steps will not change the performance of a Nearest Neighbor classifier that uses L1 distance? Select all that apply.

  1. Subtracting the mean \(\mu\) (\(\tilde{p}_{ij}^{(k)}=p_{ij}^{(k)}-\mu\).)
  2. Subtracting the per pixel mean \(\mu_{ij}\) (\(\tilde{p}_{ij}^{(k)}=p_{ij}^{(k)}-\mu_{ij}\).)
  3. Subtracting the mean \(\mu\) and dividing by the standard deviation \(\sigma\).
  4. Subtracting the pixel-wise mean \(\mu_{ij}\) and dividing by the pixel-wise standard deviation \(\sigma_{ij}\).
  5. Rotating the coordinate axes of the data.

\(\color{blue}{\textit Your Answer:}\)

\(\color{blue}{\textit Your Explanation:}\)

猜你喜欢

转载自www.cnblogs.com/beidounanhua/p/12058896.html