Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
hanlint committed Mar 1, 2022
1 parent d641fb3 commit 7714b13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions notebooks/custom_method_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we will define a model. For this, we will simply use composer's ResNet56. For using your own custom model, please see the [custom models tutorial](https://docs.mosaicml.com/en/v0.3.1/tutorials/adding_models_datasets.html#models). One quirk to be aware of with this model is that the forward method takes in an (X, y) pair of inputs and targets, essentially what the dataloaders will spit out."
"Next, we will define a model. For this, we will simply use composer's ResNet56. For using your own custom model, please see the [custom models tutorial](https://docs.mosaicml.com/en/stable/tutorials/adding_models_datasets.html#models). One quirk to be aware of with this model is that the forward method takes in an (X, y) pair of inputs and targets, essentially what the dataloaders will spit out."
]
},
{
Expand Down Expand Up @@ -184,7 +184,7 @@
"source": [
"\n",
"\n",
"For this tutorial, we'll look at how to implement one of the simpler speedup methods currently in our composer library: [ColOut](https://docs.mosaicml.com/en/v0.3.1/method_cards/col_out.html). This method works on image data by dropping random rows and columns from the training images. This reduces the size of the training images, which reduces the time per training iteration, and hopefully does not alter the semantic content of the image too much. Additionally, dropping a small fraction of random rows and columns can also slightly distort objects, and perhaps provide a data augmentation effect.\n",
"For this tutorial, we'll look at how to implement one of the simpler speedup methods currently in our composer library: [ColOut](https://docs.mosaicml.com/en/stable/method_cards/col_out.html). This method works on image data by dropping random rows and columns from the training images. This reduces the size of the training images, which reduces the time per training iteration, and hopefully does not alter the semantic content of the image too much. Additionally, dropping a small fraction of random rows and columns can also slightly distort objects, and perhaps provide a data augmentation effect.\n",
"\n",
"To start our implementation, we'll write a function to drop random rows and columns from a batch of input images. We'll assume that these are torch tensors and operate on a batch rather than individual images for simplicity here.\n",
"\n"
Expand Down
2 changes: 1 addition & 1 deletion notebooks/nlp_notebook_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We will now specify a composer `Trainer` object and run our training! `Trainer` has many arguments that are described in our [documentation](https://docs.mosaicml.com/en/v0.3.1/trainer.html#composer.Trainer), but let's discuss the less obvious arguments used below:\n",
"We will now specify a composer `Trainer` object and run our training! `Trainer` has many arguments that are described in our [documentation](https://docs.mosaicml.com/en/stable/trainer.html#composer.Trainer), but let's discuss the less obvious arguments used below:\n",
"- `max_duration` - a string specifying how long to train either in terms of batches (e.g. '10ba' is 10 batches) or epochs (e.g. '1ep' is 1 epoch).\n",
"- `schedulers` - a list of PyTorch learning rate schedulers that will be composed together.\n",
"- `device` - specifies if the training will be done on CPU or GPU by using 'cpu' or 'gpu', respectively.\n",
Expand Down
8 changes: 4 additions & 4 deletions notebooks/up_and_running_with_composer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"source": [
"## Model\n",
"\n",
"Next, we create our model. We're using composer's built-in ResNet56. To use your own custom model, please see the [custom models tutorial](https://docs.mosaicml.com/en/v0.3.1/tutorials/adding_models_datasets.html#models)."
"Next, we create our model. We're using composer's built-in ResNet56. To use your own custom model, please see the [custom models tutorial](https://docs.mosaicml.com/en/stable/tutorials/adding_models_datasets.html#models)."
]
},
{
Expand Down Expand Up @@ -232,7 +232,7 @@
"source": [
"One of the things we're most excited about at MosaicML is our speed-up algorithms. We used these algorithms to [speed up training of ResNet50 on ImageNet by up to 3.4x](https://app.mosaicml.com/explorer/imagenet). Let's try applying a few algorithms to make our ResNet56 more efficient.\n",
"\n",
"We'll start with [ColOut](https://docs.mosaicml.com/en/v0.3.1/method_cards/col_out.html), which is an in-house invention. Colout drops rows and columns of an image with probability *p*. It's a little bit like [Random Erasing](https://arxiv.org/abs/1708.04896) except it reduces the size of the image, which can increase data throughput and speed up training."
"We'll start with [ColOut](https://docs.mosaicml.com/en/stable/method_cards/col_out.html), which is an in-house invention. Colout drops rows and columns of an image with probability *p*. It's a little bit like [Random Erasing](https://arxiv.org/abs/1708.04896) except it reduces the size of the image, which can increase data throughput and speed up training."
]
},
{
Expand All @@ -248,7 +248,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's also use [BlurPool](https://docs.mosaicml.com/en/v0.3.1/method_cards/blurpool.html), which increases accuracy by applying a spatial low-pass filter before the pool in max pooling and whenever using a strided convolution."
"Let's also use [BlurPool](https://docs.mosaicml.com/en/stable/method_cards/blurpool.html), which increases accuracy by applying a spatial low-pass filter before the pool in max pooling and whenever using a strided convolution."
]
},
{
Expand All @@ -268,7 +268,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Our final algorithm in our improved training recipe is [Progressive Image Resizing](https://docs.mosaicml.com/en/v0.3.1/method_cards/progressive_resizing_vision.html). Progressive Image Resizing initially shrinks the size of training images and slowly scales them back to their full size over the course of training. It increases throughput during the early phase of training, when the network may learn coarse-grained features that do not require details lost by reducing image resolution."
"Our final algorithm in our improved training recipe is [Progressive Image Resizing](https://docs.mosaicml.com/en/stable/method_cards/progressive_resizing_vision.html). Progressive Image Resizing initially shrinks the size of training images and slowly scales them back to their full size over the course of training. It increases throughput during the early phase of training, when the network may learn coarse-grained features that do not require details lost by reducing image resolution."
]
},
{
Expand Down

0 comments on commit 7714b13

Please sign in to comment.