k-Nearest Neighbor

CS231n课程笔记翻译:图像分类笔记(上)
CS231n课程笔记翻译:图像分类笔记(下)



1 With N examples, how fast are training and prediction?

  • Train O(1)
  • predict O(N)

This is bad: we want classifiers that are fast at prediction; slow for training is ok.

2 hyper-parameters(choices about the algorithm that we set rather than learn)

  • What is the best distance to use?
  • What is the best value of k to use?

3 k-Nearest Neighbor on images never used

  • Very slow at test time

  • Distance metrics on pixels are not informative
    在这里插入图片描述

  • Curse of dimensionality(维数灾难)
    维数越高,需要填充的样本指数级增长
    在这里插入图片描述

4 Difference between L1 and L2

在这里插入图片描述

demo: http://vision.stanford.edu/teaching/cs231n-demos/knn/
在这里插入图片描述

机器学习中的范数规则化之(一)L0、L1与L2范数

5 Algorithm

The kNN classifier consists of two stages:

  • During training, the classifier takes the training data and simply remembers it
  • During testing, kNN classifies every test image by comparing to all training images and transfering the labels of the k most similar training examples
  • The value of k is cross-validated

在这里插入图片描述

5.1 下载数据集

apt-get install wget
cd cs231n/datasets/
sh get_datasets.sh

数据集构成

Training data shape:  (50000, 32, 32, 3)
Training labels shape:  (50000,)
Test data shape:  (10000, 32, 32, 3)
Test labels shape:  (10000,)

Database of deep learning(Classification and Object detection )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值