# Contents
- [LeNet Description](#lenet-description)
- [Model Architecture](#model-architecture)
- [Dataset](#dataset)
- [Environment Requirements](#environment-requirements)
- [Quick Start](#quick-start)
- [Script Description](#script-description)
- [Script and Sample Code](#script-and-sample-code)
- [Script Parameters](#script-parameters)
- [Training Process](#training-process)
- [Training](#training)
- [Evaluation Process](#evaluation-process)
- [Evaluation](#evaluation)
- [Model Description](#model-description)
- [Performance](#performance)
- [Evaluation Performance](#evaluation-performance)
- [ModelZoo Homepage](#modelzoo-homepage)
# [LeNet Description](#contents)
LeNet was proposed in 1998, a typical convolutional neural network. It was used for digit recognition and got big success.
[Paper](https://ieeexplore.ieee.org/document/726791): Y.Lecun, L.Bottou, Y.Bengio, P.Haffner. Gradient-Based Learning Applied to Document Recognition. *Proceedings of the IEEE*. 1998.
# [Model Architecture](#contents)
LeNet is very simple, which contains 5 layers. The layer composition consists of 2 convolutional layers and 3 fully connected layers.
# [Dataset](#contents)
Dataset used: [MNIST](<http://yann.lecun.com/exdb/mnist/>)
- Dataset size:52.4M,60,000 28*28 in 10 classes
- Train:60,000 images
- Test:10,000 images
- Data format:binary files
- Note:Data will be processed in dataset.py
- The directory structure is as follows:
```
└─Data
├─test
│ t10k-images.idx3-ubyte
│ t10k-labels.idx1-ubyte
│
└─train
train-images.idx3-ubyte
train-labels.idx1-ubyte
```
# [Environment Requirements](#contents)
- Hardware(Ascend/GPU/CPU)
- Prepare hardware environment with Ascend, GPU, or CPU processor.
- Framework
- [MindSpore](https://www.mindspore.cn/install/en)
- For more information, please check the resources below:
- [MindSpore Tutorials](https://www.mindspore.cn/tutorial/training/en/master/index.html)
- [MindSpore Python API](https://www.mindspore.cn/doc/api_python/en/master/index.html)
# [Quick Start](#contents)
After installing MindSpore via the official website, you can start training and evaluation as follows:
```python
# enter script dir, train LeNet
sh run_standalone_train_ascend.sh [DATA_PATH] [CKPT_SAVE_PATH]
# enter script dir, evaluate LeNet
sh run_standalone_eval_ascend.sh [DATA_PATH] [CKPT_NAME]
```
# [Script Description](#contents)
## [Script and Sample Code](#contents)
```
├── cv
├── lenet
├── README.md // descriptions about lenet
├── requirements.txt // package needed
├── scripts
│ ├──run_standalone_train_cpu.sh // train in cpu
│ ├──run_standalone_train_gpu.sh // train in gpu
│ ├──run_standalone_train_ascend.sh // train in ascend
│ ├──run_standalone_eval_cpu.sh // evaluate in cpu
│ ├──run_standalone_eval_gpu.sh // evaluate in gpu
│ ├──run_standalone_eval_ascend.sh // evaluate in ascend
├── src
│ ├──dataset.py // creating dataset
│ ├──lenet.py // lenet architecture
│ ├──config.py // parameter configuration
├── train.py // training script
├── eval.py // evaluation script
```
## [Script Parameters](#contents)
```python
Major parameters in train.py and config.py as follows:
--data_path: The absolute full path to the train and evaluation datasets.
--epoch_size: Total training epochs.
--batch_size: Training batch size.
--image_height: Image height used as input to the model.
--image_width: Image width used as input the model.
--device_target: Device where the code will be implemented. Optional values
are "Ascend", "GPU", "CPU".
--checkpoint_path: The absolute full path to the checkpoint file saved
after training.
--data_path: Path where the dataset is saved
```
## [Training Process](#contents)
### Training
```
python train.py --data_path Data --ckpt_path ckpt > log.txt 2>&1 &
or enter script dir, and run the script
sh run_standalone_train_ascend.sh Data ckpt
```
After training, the loss value will be achieved as follows:
```
# grep "loss is " log.txt
epoch: 1 step: 1, loss is 2.2791853
...
epoch: 1 step: 1536, loss is 1.9366643
epoch: 1 step: 1537, loss is 1.6983616
epoch: 1 step: 1538, loss is 1.0221305
...
```
The model checkpoint will be saved in the current directory.
## [Evaluation Process](#contents)
### Evaluation
Before running the command below, please check the checkpoint path used for evaluation.
```
python eval.py --data_path Data --ckpt_path ckpt/checkpoint_lenet-1_1875.ckpt > log.txt 2>&1 &
or enter script dir, and run the script
sh run_standalone_eval_ascend.sh Data ckpt/checkpoint_lenet-1_1875.ckpt
```
You can view the results through the file "log.txt". The accuracy of the test dataset will be as follows:
```
# grep "Accuracy: " log.txt
'Accuracy': 0.9842
```
# [Model Description](#contents)
## [Performance](#contents)
### Evaluation Performance
| Parameters | LeNet |
| -------------------------- | ----------------------------------------------------------- |
| Resource | Ascend 910 ;CPU 2.60GHz,56cores;Memory,314G |
| uploaded Date | 06/09/2020 (month/day/year) |
| MindSpore Version | 0.5.0-beta |
| Dataset | MNIST |
| Training Parameters | epoch=10, steps=1875, batch_size = 32, lr=0.01 |
| Optimizer | Momentum |
| Loss Function | Softmax Cross Entropy |
| outputs | probability |
| Loss | 0.002 |
| Speed | 1.70 ms/step |
| Total time | 43.1s | |
| Checkpoint for Fine tuning | 482k (.ckpt file) |
| Scripts | https://gitee.com/mindspore/mindspore/tree/master/model_zoo/official/cv/lenet |
# [Description of Random Situation](#contents)
In dataset.py, we set the seed inside ```create_dataset``` function.
# [ModelZoo Homepage](#contents)
Please check the official [homepage](https://gitee.com/mindspore/mindspore/tree/master/model_zoo).
没有合适的资源?快使用搜索试试~ 我知道了~
哈尔滨工业大学2022秋季学期人工智能课程实验、作业、课件以及期末复习材料.zip
共139个文件
ckpt:40个
py:26个
docx:15个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 39 浏览量
2024-03-09
21:40:06
上传
评论
收藏 214.44MB ZIP 举报
温馨提示
哈尔滨工业大学2022秋季学期人工智能课程实验、作业、课件以及期末复习材料
资源推荐
资源详情
资源评论
收起资源包目录
哈尔滨工业大学2022秋季学期人工智能课程实验、作业、课件以及期末复习材料.zip (139个子文件)
checkpoint_lenet_3-10_1875.ckpt 483KB
checkpoint_lenet-6_1875.ckpt 483KB
checkpoint_lenet_2-6_1875.ckpt 483KB
checkpoint_lenet_3-9_1875.ckpt 483KB
checkpoint_lenet_2-4_1875.ckpt 483KB
checkpoint_lenet_1-5_1875.ckpt 483KB
checkpoint_lenet-1_1875.ckpt 483KB
checkpoint_lenet_1-9_1875.ckpt 483KB
checkpoint_lenet-7_1875.ckpt 483KB
checkpoint_lenet_2-5_1875.ckpt 483KB
checkpoint_lenet-2_1875.ckpt 483KB
checkpoint_lenet_3-3_1875.ckpt 483KB
checkpoint_lenet_2-8_1875.ckpt 483KB
checkpoint_lenet_3-8_1875.ckpt 483KB
checkpoint_lenet_1-8_1875.ckpt 483KB
checkpoint_lenet_3-4_1875.ckpt 483KB
checkpoint_lenet_3-1_1875.ckpt 483KB
checkpoint_lenet-4_1875.ckpt 483KB
checkpoint_lenet-9_1875.ckpt 483KB
checkpoint_lenet_3-2_1875.ckpt 483KB
checkpoint_lenet-3_1875.ckpt 483KB
checkpoint_lenet_2-1_1875.ckpt 483KB
checkpoint_lenet_1-2_1875.ckpt 483KB
checkpoint_lenet_3-6_1875.ckpt 483KB
checkpoint_lenet_1-3_1875.ckpt 483KB
checkpoint_lenet_1-1_1875.ckpt 483KB
checkpoint_lenet_2-10_1875.ckpt 483KB
checkpoint_lenet_2-2_1875.ckpt 483KB
checkpoint_lenet_1-4_1875.ckpt 483KB
checkpoint_lenet_2-9_1875.ckpt 483KB
checkpoint_lenet_3-5_1875.ckpt 483KB
checkpoint_lenet-8_1875.ckpt 483KB
checkpoint_lenet_1-7_1875.ckpt 483KB
checkpoint_lenet_2-7_1875.ckpt 483KB
checkpoint_lenet_3-7_1875.ckpt 483KB
checkpoint_lenet_1-10_1875.ckpt 483KB
checkpoint_lenet-5_1875.ckpt 483KB
checkpoint_lenet_2-3_1875.ckpt 483KB
checkpoint_lenet_1-6_1875.ckpt 483KB
checkpoint_lenet-10_1875.ckpt 483KB
Lab3class.class 8KB
Lab3.class 8KB
Note.class 526B
Note.class 514B
猴子摘香蕉.cpp 3KB
2019年人工智能试卷.doc 239KB
人工智能第二次作业.docx 3.67MB
人工智能四基于Mindspore框架与ModelArts平台的MNIST手写体识别实验.docx 2.92MB
人工智能实验二搜索求解.docx 2.08MB
人工智能第七次作业.docx 1.58MB
人工智能实验一知识表示.docx 1.35MB
人工智能实验三不确定性推理.docx 1.32MB
人工智能第六次作业.docx 599KB
人工智能第三次作业.docx 532KB
人工智能第四次作业.docx 393KB
人工智能第八次作业.docx 323KB
人工智能第五次作业.docx 244KB
人工智能第一次作业.docx 21KB
Ch03 确定性与不确定性推理 习题.docx 19KB
Ch03 确定性推理 附加练习不做要求.docx 13KB
人工智能考试大纲.docx 13KB
猴子摘香蕉.exe 3MB
.gitignore 50B
train-images-idx3-ubyte.gz 9.45MB
t10k-images-idx3-ubyte.gz 1.57MB
train-labels-idx1-ubyte.gz 28KB
t10k-labels-idx1-ubyte.gz 4KB
Lab3class.java 11KB
Lab3.java 10KB
Note.java 320B
Note.java 302B
LICENSE 34KB
README.md 7KB
README.md 218B
checkpoint_lenet_3-graph.meta 22KB
checkpoint_lenet-graph.meta 22KB
checkpoint_lenet_2-graph.meta 22KB
checkpoint_lenet_1-graph.meta 22KB
人工智能原理及其应用.pdf 55.5MB
Artificial Intelligence A Modern Approach 3rd.pdf 19.83MB
Machine Learning Interview Cheat sheets.pdf 6.13MB
新一代知识图谱关键技术综述.pdf 3.16MB
哈尔滨工业大学2019《人工智能》试题和答案.pdf 1.07MB
《新一代人工智能伦理规范》.pdf 285KB
1.png 578B
Chapter06 机器学习.pptx 27.11MB
Chapter05 博弈树与MCTS.pptx 23.27MB
深度学习.pptx 13.09MB
Chapter02 知识表示.pptx 11.9MB
强化学习.pptx 10.52MB
无监督学习.pptx 10.24MB
贝叶斯1.pptx 9.31MB
Chapter03 确定性推理.pptx 1.76MB
Chapter04 不确定性推理.pptx 486KB
searchTestClasses.py 32KB
graphicsDisplay.py 27KB
pacman.py 26KB
util.py 25KB
searchAgents.py 25KB
game.py 25KB
共 139 条
- 1
- 2
资源评论
极致人生-010
- 粉丝: 3237
- 资源: 3077
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python-leetcode面试题解之第198题打家劫舍-题解.zip
- python-leetcode面试题解之第191题位1的个数-题解.zip
- python-leetcode面试题解之第186题反转字符串中的单词II-题解.zip
- 一个基于python的web后端高性能开发框架,下载可用
- python-leetcode面试题解之第179题最大数-题解.zip
- python-leetcode面试题解之第170题两数之和III数据结构设计-题解.zip
- python-leetcode面试题解之第168题Excel表列名称-题解.zip
- python-leetcode面试题解之第167题两数之和II输入有序数组-题解.zip
- python-leetcode面试题解之第166题分数到小数-题解.zip
- python-leetcode面试题解之第165比较版本号-题解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功