翻译自:https://caffe2.ai/docs/tutorials

教程安装|Tutorials Installation

Caffe2学习文档安装

选择你的路径|Pick Your Path

  1. 使用一个现成的预训练模型 (初级)
  2. 编写自己的神经网络 (中级)
  3. 做一个应用深度学习技术的移动端APP (高级)

1:里面的几个栗子使用预先训练好的模型,我们展现如何让一个demo项目在数分钟内启动并运行.
2:你需要了解一些神经网络的背景知识。下面列举有需要入门的教程.
3:你会学习到,如何在iOS和Android中应用中进行图片分类。 它与Android Studio或Xcode非常兼容,但您需要整合Caffe2和C ++ hook.

不管你选什么,都别忘了回到本文中查看教程的每一章节

New to deep learning

A broad introduction is given in the free online draft of Neural Networks and Deep Learning Michael Nielsen. In particular the chapters on using neural nets and how backpropagation works are helpful if you are new to the subject.

For an exposition of neural networks in circuits and code, check out Hacker’s Guide to Neural Networks by Andrej Karpathy (Stanford).

在机器学习方面的大佬们|Experienced researchers in some facet of machine learning

The Tutorial on Deep Learning for Vision from CVPR ‘14 is a good companion tutorial for researchers. Once you have the framework and practice foundations from the Caffe tutorial, explore the fundamental ideas and advanced research directions in the CVPR ‘14 tutorial.

These recent academic tutorials cover deep learning for researchers in machine learning and vision:

Tutorials and Example Scripts

The IPython notebook tutorials and example scripts we have provided below will guide you through the Caffe2 Python interface. Some tutorials have been generously provided by the Caffe community and we welcome more contributions of this kind to help others get ramped up more quickly and to try out the many different uses of Caffe2. The IPython notebook tutorials can be browsed or downloaded using the links below each tutorial’s title. You may browse these ipynb files on Github directly and this is the preferred route if you just want to look at the code and try it out for yourself. However, it is recommended to run them in Jupyter Notebook and take advantage of their interactivity. Installation instructions below will show you how to do this. Skip this part if you want to jump right into the tutorial descriptions below.

Example Scripts

/caffe2/python/examples目录下有些实例脚本,用来学习开始使用caffe2是非常棒的资源。

  • char_rnn.py: 生成一个循环卷积神经网络,它将对您输入的文本进行采样,并随机生成相似风格的文本。RNN和LSTM页面有关于此脚本用法的更多信息。

  • lmdb_create_example.py: 创建一个随机图像数据和标签的lmdb数据库,这些数据和标签可用于构建自己的数据导入框架

  • resnet50_trainer.py: 用于Resnet 50的并行多GPU分布式训练器。比如,可用于训练imagenet数据。 SGD的同步页面有关于此脚本用法的更多信息。

Beginner Tutorials

入门的模型和数据集|Models and Datasets - a Primer

刚刚接触caffe和深度学习吗?从这里开始,你会找到很多不同的模型和数据集。

加载预先训练的模型|Loading Pre-trained Models

利用动物园模型并抓取一些预先训练好的模型,并将它们用于测试。 本教程提供了一系列不同的模型,并准备就绪,向您展示启动您的神经网络的基本步骤。 然后你可以放入一些图片或其他测试给他们,看看他们的表现如何。

图片预处理|Image Pre-Processing Pipeline

学习如何让您的图像准备好接受预先训练的模型,或作为测试图像与其他数据集一起使用。 从手机到网络摄像头到新的医学图像,您都需要考虑图像摄入入口,以及考虑在图像分类过程中的速度和准确性。

  • 调整大小
  • 改变尺度比例
  • HWC 到 CHW(H:height;W:width;C:channel)
  • RGB 到 BRG
  • 为Caffe2的拾取图片的预处理

New to caffe2

Caffe到Caffe2的转变

查看Caffe2的介绍,你可以把你的Caffe模型转换成Caffe2.

Intro Tutorial

接下来的教程让你逐渐离开blobs,开始用Caffe2的workspace和 tensors. 其中包括了 nets 和 operators ,以及如何建立一个简易的模型,并执行。

Basics of Caffe2 - Workspaces, Operators, and Nets

这份IPython 教程介绍了一些基本的Caffe2 组件:

  • Workspaces(工作区)
  • Operators(运算符)
  • Nets(网络)

建造模型|Brewing Models

教程介绍,通过简单的调用API来建立的模型,你会学到:

  • Operators vs. helper functions
  • brew and arg_scope
  • Making custom helper functions

使用caffe2提取特征,建立线性回归模型|Toy Regression - Plotting Lines & Random Data

教程介绍了如何用Caffe2提取特征,以简单的线性回归建立模型

  • generate some sample random data as the input for the model
  • create a network with this data
  • automatically train the model
  • review stochastic gradient descent results and changes to your ground truth parameters as the network learned

Intermediate Tutorials

MNIST-手写图像识别|MNIST - Handwriting Recognition

教程创建了一个小型的能识别手写的卷积神经网络. 我们使用从MNIST数据集中得到的手写图像,作为卷积神经网络的训练和测试. 这是一个包含6万张图500个人手写图像的的合集,用来训练CNN. 另一组1万张图片(和训练图片不同)用来测试CNN的准确性.

创建你自己的数据集|Create Your Own Dataset

尝试导入并调整数据,以便于在Caffe2中使用。本教程使用Iris数据集.

Advanced Tutorials

使用多个GPU训练Caffe2|Multi-GPU Training with Caffe2

在本教程中,我们将探索多GPU的训练。我们将向您展示使用data_parallel_model快速处理ImageNet数据库的一个子集的基本结构,它与ResNet-50 model模型的设计相同。
我们还将有机会深入了解一些Caffe2的C ++操作符,这些操作符可以高效地处理图像管道,构建ResNet模型,在单个GPU上训练并显示data_parallel_model中包含的一些优化,最后我们将扩展它并展示如何并行化您的模型,以便您可以在多个GPU上运行它。

Write Your Own Tutorial!

有一个你自己创建的教程,或者一些建议? 创建一个Issue到github来讨论。 项目的 Tutorials repository 有很多信息或者你可以直接来 创建一个PR|Create a Pull Request 来讨论你写的教程.

Would you like to know more?.

Operators

Caffe2中一个基本的运算单元就是运算符|Operators.

Writing Your Own Operators

非常棒的想法!编写自定义的运算符,并和社区分享!参考编写运算符的教程: