Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Tutorials have moved to their own repo. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
orionr committed Mar 29, 2018
1 parent 8d84653 commit e91a233
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion _docs/brew.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ from caffe2.python import brew
brew.fc(model, blob_in, blob_out, ...)
```

That's pretty much the same as using the helper function directly, however `brew` really starts to shine once your models get more complicated. The following is a LeNet model building example, extracted from the [MNIST tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/MNIST.ipynb).
That's pretty much the same as using the helper function directly, however `brew` really starts to shine once your models get more complicated. The following is a LeNet model building example, extracted from the [MNIST tutorial](https://github.com/caffe2/tutorials/blob/master/MNIST.ipynb).

```py
from caffe2.python import brew
Expand Down
2 changes: 1 addition & 1 deletion _docs/caffe-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Converting your models from original Caffe is relatively easy. We provide a tuto

Here you can find a tutorial with examples of downloading models from Caffe's original repository that you can use with the Caffe2 translator. Skip this if you're starting from scratch and just want to learn Caffe2.

[Browse the IPython Tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Getting_Caffe1_Models_for_Translation.ipynb)
[Browse the IPython Tutorial](https://github.com/caffe2/tutorials/blob/master/Getting_Caffe1_Models_for_Translation.ipynb)

#### Converting Models from Caffe to Caffe2

Expand Down
2 changes: 1 addition & 1 deletion _docs/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: /docs/datasets.html

As you get familiar with Machine Learning and Neural Networks you will want to use datasets that have been provided by academia, industry, government, and even other users of Caffe2. Many of these datasets have already been trained with Caffe and/or Caffe2, so you can jump right in and start using these pre-trained models. You can also fine-tune or even do "mashups" with pre-trained models by adding additional data, models, parameters, or combinations thereof to train a new custom model for your experiments. If you think you've found something great, then don't hesitate to share! This is an Open Source project and we really hope to foster innovation and collaboration.

For further info on datasets and how to prepare them take a look at the [Models and Datasets tutorial](tutorial-models-and-datasets.html). You can also check out a [Caffe2 Python tutorial](tutorial-MNIST.html) that downloads MNIST handwriting dataset, unzips it, calls a Caffe2 provided binary that will extract/transform/load (ETL) the data into a database of key value pairs (KVPs) - in this case it uses [LevelDB](https://github.com/google/leveldb) to store the images. The tutorial goes on to show how the dataset is used to train a neural network that can be used to identify handwriting of numbers. This tutorial is [also available](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/MNIST.ipynb) as a [Juypter notebook](http://caffe2.ai/docs/tutorials.html#null__tutorials-installation).
For further info on datasets and how to prepare them take a look at the [Models and Datasets tutorial](tutorial-models-and-datasets.html). You can also check out a [Caffe2 Python tutorial](tutorial-MNIST.html) that downloads MNIST handwriting dataset, unzips it, calls a Caffe2 provided binary that will extract/transform/load (ETL) the data into a database of key value pairs (KVPs) - in this case it uses [LevelDB](https://github.com/google/leveldb) to store the images. The tutorial goes on to show how the dataset is used to train a neural network that can be used to identify handwriting of numbers. This tutorial is [also available](https://github.com/caffe2/tutorials/blob/master/MNIST.ipynb) as a [Juypter notebook](http://caffe2.ai/docs/tutorials.html#null__tutorials-installation).

You may also want to check out the pre-trained models at [Caffe2's Model Zoo](zoo.html)! You might find examples there where these datasets have been used to train models, be able to draw from their project's open source code, and be informed of dataset-specific best practices for training models.

Expand Down
4 changes: 2 additions & 2 deletions _docs/docker-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permalink: /docs/docker-setup.html

```
docker load -i /Volumes/CAFFE2/c2.gpu.tutorial.0.7.0.tar
docker run -it -p 8888:8888 cc2.gpu.tutorial.0.7.0 sh -c "jupyter notebook --no-browser --ip 0.0.0.0 /caffe2/caffe2/python/tutorials"
docker run -it -p 8888:8888 cc2.gpu.tutorial.0.7.0 sh -c "jupyter notebook --no-browser --ip 0.0.0.0 /caffe2_tutorials"
```

Essentially you need to locate the tar file, whatever its name is and import it with `docker load -i <path-to-image-tar-file>`
Expand Down Expand Up @@ -68,7 +68,7 @@ docker images
Assuming it's there you can now launch it:

```
docker run -it -p 8888:8888 c2.gpu.tutorial.0.7.0 sh -c "jupyter notebook --no-browser --ip 0.0.0.0 /caffe2/caffe2/python/tutorials"
docker run -it -p 8888:8888 c2.gpu.tutorial.0.7.0 sh -c "jupyter notebook --no-browser --ip 0.0.0.0 /caffe2_tutorials"
```

This will output a URL. You just need to copy the provided URL/token combo into your browser and you should see the folder with tutorials.
Expand Down
4 changes: 2 additions & 2 deletions _docs/getting-started/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ If you want to run your Jupyter server from a Docker container, then you'll need

```
docker run -it -p 8888:8888 caffe2ai/caffe2:cpu-fulloptions-ubuntu14.04 sh -c "jupyter notebook --no-browser --ip 0.0.0.0 /caffe2/caffe2/python/tutorials"
docker run -it -p 8888:8888 caffe2ai/caffe2:cpu-fulloptions-ubuntu14.04 sh -c "jupyter notebook --no-browser --ip 0.0.0.0 /caffe2_tutorials"
```

Your output will be along these lines below. You just need to copy the provided URL/token combo into your browser and you should see the folder with tutorials. Note the if you installed caffe2 in a different spot, then update the optional path that is in the command `/caffe2/caffe2/python/tutorials` to match where the tutorials are located.
Your output will be along these lines below. You just need to copy the provided URL/token combo into your browser and you should see the folder with tutorials. Note the if you installed caffe2 in a different spot, then update the optional path that is in the command `/caffe2_tutorials` to match where the tutorials are located.

![jupyter docker launch screenshot](../static/images/jupyter-docker-launch.png)

Expand Down
2 changes: 1 addition & 1 deletion _docs/sync-sgd.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There are multiple ways to utilize multiple GPUs or machines to train models. Sy

Parallelizing a model is done by module [caffe2.python.data_parallel_model](/doxygen-python/html/namespacedata__parallel__model.html). The model must be created using a ModelHelper, such as [model_helper.ModelHelper](https://github.com/caffe2/caffe2/blob/master/caffe2/python/model_helper.py).

For a full-length tutorial building ResNet-50 for a single GPU, then using `Parallelize_GPU` for multiple GPU check out this [tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Multi-GPU_Training.ipynb)
For a full-length tutorial building ResNet-50 for a single GPU, then using `Parallelize_GPU` for multiple GPU check out this [tutorial](https://github.com/caffe2/tutorials/blob/master/Multi-GPU_Training.ipynb)
Here is example from the [Resnet-50 example code](https://github.com/caffe2/caffe2/blob/master/caffe2/python/examples/resnet50_trainer.py):

```python
Expand Down
4 changes: 2 additions & 2 deletions _docs/tutorial-MNIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: /docs/tutorial-MNIST.html

This tutorial creates a small convolutional neural network (CNN) that can identify handwriting. To train and test the CNN, we use handwriting imagery from the MNIST dataset. This is a collection of 60,000 images of 500 different people's handwriting that is used for training your CNN. Another set of 10,000 test images (different from the training images) is used to test the accuracy of the resulting CNN.

[Browse the IPython Tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/MNIST.ipynb)
[Browse the IPython Tutorial](https://github.com/caffe2/tutorials/blob/master/MNIST.ipynb)

First, let's import the necessities.

Expand Down Expand Up @@ -92,7 +92,7 @@ print("workspace root folder:" + root_folder)
workspace root folder:/Users/aaronmarkham/caffe2_notebooks/tutorial_files/tutorial_mnist


> If the database wasn't found in the last step, [download the MNIST lmdb database](https://download.caffe2.ai/databases/mnist-lmdb.zip) or review the [datasets and databases notebook](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/MNIST_Dataset_and_Databases.ipynb) on how to create the database from the MNIST dataset.
> If the database wasn't found in the last step, [download the MNIST lmdb database](https://download.caffe2.ai/databases/mnist-lmdb.zip) or review the [datasets and databases notebook](https://github.com/caffe2/tutorials/blob/master/MNIST_Dataset_and_Databases.ipynb) on how to create the database from the MNIST dataset.
We will be using the `ModelHelper` class to represent our main model and using `brew` module and `Operators` to build our model. `brew` module has a set of wrapper functions that automatically separates the parameter intialization and the actual computation into two networks. Under the hood, a `ModelHelper` object has two underlying nets, `param_init_net` and `net`, that keeps record of the initialization network and the main network respectively.

Expand Down
2 changes: 1 addition & 1 deletion _docs/tutorial-basics-of-caffe2.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This tutorial introduces a few basic Caffe2 components:

You also may want to review the [Intro Tutorial](intro-tutorial) before starting this notebook.

[Browse the Tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Basics.ipynb)
[Browse the Tutorial](https://github.com/caffe2/tutorials/blob/master/Basics.ipynb)

In this tutorial we will go through a set of Caffe2 basics: the basic concepts including how operators and nets are being written.

Expand Down
Binary file modified _docs/tutorial-create-your-own-dataset.md
Binary file not shown.
4 changes: 2 additions & 2 deletions _docs/tutorial-image-pre-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Learn how to get your images ready for ingestion into pre-trained models or as t
* RGB to BRG
* image prep for Caffe2 ingestion

[Browse the IPython Tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Image_Pre-Processing_Pipeline.ipynb)
[Browse the IPython Tutorial](https://github.com/caffe2/tutorials/blob/master/Image_Pre-Processing_Pipeline.ipynb)

In this tutorial we're going to look at how we can load in images from a local file or a URL which you can then utilize in other tutorials or examples. Also, we're going to go in depth on the kinds of preprocessing that is necessary to utilize Caffe2 with images.

#### Mac OSx Prerequisites
#### MacOS X Prerequisites

First make sure you have the Python modules you'll need.

Expand Down
2 changes: 1 addition & 1 deletion _docs/tutorial-loading-pre-trained-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permalink: /docs/tutorial-loading-pre-trained-models.html

Take advantage of the [Model Zoo](https://github.com/caffe2/caffe2/wiki/Model-Zoo) and grab some pre-trained models and take them for a test drive. You can find different models that are ready to go and here we will show you the basic steps for prepping them and firing up your neural net. Then you can throw some images or other tests at them and see how they perform.

[Browse the IPython Tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Loading_Pretrained_Models.ipynb)
[Browse the IPython Tutorial](https://github.com/caffe2/tutorials/blob/master/Loading_Pretrained_Models.ipynb)

## Model Download Options

Expand Down
2 changes: 1 addition & 1 deletion _docs/tutorial-toy-regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This tutorial shows how to use more Caffe2 features with simple linear regressio
* automatically train the model
* review stochastic gradient descent results and changes to your ground truth parameters as the network learned

[Browse the Tutorial](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Toy_Regression.ipynb)
[Browse the Tutorial](https://github.com/caffe2/tutorials/blob/master/Toy_Regression.ipynb)

This is a quick example showing how one can use the concepts introduced in the Basics tutorial to do a quick toy regression.

Expand Down
24 changes: 15 additions & 9 deletions _docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ permalink: /docs/tutorials.html

## Tutorials Installation

First download the tutorials source.

```bash
git clone --recursive https://github.com/caffe2/tutorials caffe2_tutorials
```

To run the tutorials you will need some third-party libraries, including [ipython-notebooks](http://jupyter.org/install.html) and [matplotlib](http://matplotlib.org/users/installing.html). You can install everything you'll need with the following command.

> Anaconda users: If you're using Anaconda, use `conda install` instead of `pip install`.
Expand Down Expand Up @@ -38,13 +44,13 @@ For Ubuntu run : ```apt-get install unzip zeromq ```

For Centos run : ```yum install unzip zeromq ```

Then run the shell script included in the `caffe2/caffe2/python/tutorials` folder:
Then run the shell script in the `caffe2_tutorials` folder:

```bash
./start_ipython_notebook.sh
```

Or you can run `jupyter notebook`, and when your browser opens with your local Jupyter server (default is http://localhost:8888), browse to the Caffe2 repository and look for them in the `caffe2/caffe2/python/tutorials` directory. Opening them this way will launch their interactive features just like the shell script mentioned above. The script has the additional feature of setting your PYTHONPATH environment variable.
Or you can run `jupyter notebook`, and when your browser opens with your local Jupyter server (default is http://localhost:8888), browse to the Caffe2 repository and look for them in the `caffe2_tutorials` directory. Opening them this way will launch their interactive features just like the shell script mentioned above. The script has the additional feature of setting your PYTHONPATH environment variable.

## Pick Your Path

Expand Down Expand Up @@ -98,11 +104,11 @@ There are example scripts that can be found in [/caffe2/python/examples](https:/

New to Caffe and Deep Learning? Start here and find out more about the different models and datasets available to you.

#### [Loading Pre-trained Models](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Loading_Pretrained_Models.ipynb)
#### [Loading Pre-trained Models](https://github.com/caffe2/tutorials/blob/master/Loading_Pretrained_Models.ipynb)

Take advantage of the Model Zoo and grab some pre-trained models and take them for a test drive. This tutorial has a set of different models that are ready to go and will show you the basic steps for prepping them and firing up your neural net. Then you can throw some images or other tests at them and see how they perform.

#### [Image Pre-Processing Pipeline](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Image_Pre-Processing_Pipeline.ipynb)
#### [Image Pre-Processing Pipeline](https://github.com/caffe2/tutorials/blob/master/Image_Pre-Processing_Pipeline.ipynb)

Learn how to get your images ready for ingestion into pre-trained models or as test images against other datasets. From cell phones to web cams to new medical imagery you will want to consider your image ingestion pipeline and what conversions are necessary for both speed and accuracy during any kind of image classification.

Expand All @@ -122,7 +128,7 @@ Get introduced to Caffe2 and how you can translate your old Caffe models to Caff

This follow-along tutorial starts you off with blobs, the Caffe2 workspace, and tensors. It covers nets and operators and how to build a simple model and execute it.

#### [Basics of Caffe2 - Workspaces, Operators, and Nets](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Basics.ipynb)
#### [Basics of Caffe2 - Workspaces, Operators, and Nets](https://github.com/caffe2/tutorials/blob/master/Basics.ipynb)

This IPython tutorial introduces a few basic Caffe2 components:

Expand All @@ -138,7 +144,7 @@ Another follow-along tutorial that introduces `brew`, an easy to use API for cre
* brew and arg_scope
* Making custom helper functions

#### [Toy Regression - Plotting Lines & Random Data](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Toy_Regression.ipynb)
#### [Toy Regression - Plotting Lines & Random Data](https://github.com/caffe2/tutorials/blob/master/Toy_Regression.ipynb)

This tutorial shows how to use more Caffe2 features with simple linear regression as the theme.

Expand All @@ -149,17 +155,17 @@ This tutorial shows how to use more Caffe2 features with simple linear regressio

### Intermediate Tutorials

#### [MNIST - Handwriting Recognition](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/MNIST.ipynb)
#### [MNIST - Handwriting Recognition](https://github.com/caffe2/tutorials/blob/master/MNIST.ipynb)

This tutorial creates a small convolutional neural network (CNN) that can identify handwriting. The train and test the CNN, we use handwriting imagery from the MNIST dataset. This is a collection of 60,000 images of 500 different people's handwriting that is used for training your CNN. Another set of 10,000 test images (different from the training images) is used to test the accuracy of the resulting CNN.

#### [Create Your Own Dataset](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/create_your_own_dataset.ipynb)
#### [Create Your Own Dataset](https://github.com/caffe2/tutorials/blob/master/create_your_own_dataset.ipynb)

Try your hand at importing and massaging data so it can be used in Caffe2. This tutorial uses the Iris dataset.

### Advanced Tutorials

#### [Multi-GPU Training with Caffe2](https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Multi-GPU_Training.ipynb)
#### [Multi-GPU Training with Caffe2](https://github.com/caffe2/tutorials/blob/master/Multi-GPU_Training.ipynb)

For this tutorial we will explore multi-GPU training. We will show you a basic structure for using the `data_parallel_model` to quickly process a subset of the ImageNet database along the same design as the [ResNet-50 model](https://arxiv.org/abs/1512.03385). We will also get a chance to look under the hood at a few of Caffe2's C++ operators that efficiently handle your image pipeline, build a ResNet model, train on a single GPU and show some optimizations that are included with `data_parallel_model`, and finally we'll scale it up and show you how to parallelize your model so you can run it on multiple GPUs.

Expand Down

0 comments on commit e91a233

Please sign in to comment.