Skip to content

Commit

Permalink
docs: fix tutorials typos
Browse files Browse the repository at this point in the history
  • Loading branch information
katport committed Apr 17, 2020
1 parent 13c8792 commit 17ccd19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/tutorials/pytorch-mnist-tutorial.txt
Expand Up @@ -34,6 +34,7 @@ Here is what the skeleton of our trial class looks like:

.. code:: python

import torch.nn as nn
from determined.pytorch import DataLoader, PyTorchTrial

class MNISTTrial(PyTorchTrial):
Expand Down Expand Up @@ -204,7 +205,7 @@ To create an experiment, we start by writing a configuration file which defines
smaller_is_better: true
entrypoint: model_def:MNistTrial

Rather than specifying the number of batches to train for directly, we instead specify the number of :ref:`steps <concept-step>`. By default, a step consists of 100 batches, so the config file above specifies that the model should be trained on 4000 batches of data.
Rather than specifying the number of batches to train for directly, we instead specify the number of :ref:`steps <concept-step>`. By default, a step consists of 100 batches, so the config file above specifies that the model should be trained on 900 batches of data.

The ``entrypoint`` specifies the name of the trial class to use. This is useful if our model code contains more than one trial class. In this case, we use an entrypoint of ``model_def:MNistTrial`` because our trial class is named ``MNistTrial`` and it is defined in a Python file named ``model_def.py``.

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/quick-start.txt
Expand Up @@ -67,7 +67,7 @@ Each yaml file is specific to the type of experiment we will run during this gui
Running Your First Job
-----------------------

The Determined CLI can be used to submit an experiment to the Determined cluster. Determine defines an :ref:`experiment <concept-experiment>` as a collection of one or more trials. A :ref:`trial <concept-trial>` is a training task that consists of a dataset, a deep learning model, and values for all of the model’s hyperparameters. An experiment can either train a single model (with a single trial), or can define a search over a user-defined hyperparameter space.
The Determined CLI can be used to submit an experiment to the Determined cluster. Determined defines an :ref:`experiment <concept-experiment>` as a collection of one or more trials. A :ref:`trial <concept-trial>` is a training task that consists of a dataset, a deep learning model, and values for all of the model’s hyperparameters. An experiment can either train a single model (with a single trial), or can define a search over a user-defined hyperparameter space.

We will start by training a single model for a fixed number of batches and with constant values for all of the hyperparameters. Run the following command in the ``mnist_pytorch`` directory:

Expand All @@ -84,7 +84,7 @@ Once the experiment has been submitted, you should see the following output:
Preparing files (../mnist_pytorch) to send to master... 2.5KB and 4 files
Created experiment 1

We can view the experiment status and results in the Web UI. In a browser, go to http://DET_MASTER/, where DET_MASTER is the URL or IP address of your Determined cluster. If you installed locally via ``det-deploy local``, this will likely be http://localhost:8080/ . A Determined dashboard will be displayed similar to the one below:
We can view the experiment status and results in the Web UI. In a browser, go to ``http://DET_MASTER/``, where ``DET_MASTER`` is the URL or IP address of your Determined cluster. If you installed locally via ``det-deploy local``, this will likely be ``http://localhost:8080/`` . A Determined dashboard will be displayed similar to the one below:

|

Expand Down
12 changes: 7 additions & 5 deletions docs/tutorials/tf-mnist-tutorial.txt
Expand Up @@ -34,6 +34,7 @@ Here is what the skeleton of our trial class looks like:

.. code:: python

import keras
from determined.keras import TFKerasTrial, TFKerasTrialContext

class MNISTTrial(TFKerasTrial):
Expand Down Expand Up @@ -79,7 +80,7 @@ The ``build_model`` method returns a compiled ``tf.keras.Model`` object. The MNI
model = keras.Sequential(
[
keras.layers.Flatten(input_shape=(28, 28)),
keras.layers.Dense(128, activation="relu"),
keras.layers.Dense(self.context.get_hparam("dense1"), activation="relu"),
keras.layers.Dense(10),
]
)
Expand Down Expand Up @@ -114,7 +115,7 @@ The implementation of ``build_validation_data_loader`` is similar:
test_images, test_labels = data.load_validation_data()
test_images = test_images / 255.0

return train_images, train_labels
return test_images, test_labels

.. note::
When using ``tf.keras.utils.Sequence`` or ``tf.data.Dataset``, users should specify the batch size using ``self.context.get_per_slot_batch_size()``.
Expand All @@ -131,14 +132,15 @@ To create an experiment, we start by writing a configuration file which defines
description: mnist_keras_const_simple
hyperparameters:
global_batch_size: 32
dense1: 128
searcher:
name: single
metric: val_accuracy
max_steps: 40
metric: val_loss
max_steps: 45
min_validation_period: 10
entrypoint: model_def:MNISTTrial

For this model, the only hyperparameter is the batch size. Rather than specifying the number of batches to train for directly, we instead specify the number of :ref:`steps <concept-step>`. By default, a step consists of 100 batches, so the config file above specifies that the model should be trained on 4000 batches of data.
For this model, we have two hyperparameters: the size of the ``Dense`` layer and the batch size. Rather than specifying the number of batches to train for directly, we instead specify the number of :ref:`steps <concept-step>`. For our model, one epoch is about 900 batches or about nine steps, so the config file above specifies that the model should be trained on 4,500 batches of data.

The ``entrypoint`` specifies the name of the trial class to use. This is useful if our model code contains more than one trial class. In this case, we use an entrypoint of ``model_def:MNISTTrial`` because our trial class is named ``MNISTTrial`` and it is defined in a Python file named ``model_def.py``.

Expand Down

0 comments on commit 17ccd19

Please sign in to comment.