diff --git a/docs/tutorials/pytorch-mnist-tutorial.txt b/docs/tutorials/pytorch-mnist-tutorial.txt index 3503ee32996..c82919e9517 100644 --- a/docs/tutorials/pytorch-mnist-tutorial.txt +++ b/docs/tutorials/pytorch-mnist-tutorial.txt @@ -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): @@ -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 `. 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 `. 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``. diff --git a/docs/tutorials/quick-start.txt b/docs/tutorials/quick-start.txt index 979b9ae5fcd..19d26b5d9c4 100644 --- a/docs/tutorials/quick-start.txt +++ b/docs/tutorials/quick-start.txt @@ -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 ` as a collection of one or more trials. A :ref:`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 ` as a collection of one or more trials. A :ref:`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: @@ -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: | diff --git a/docs/tutorials/tf-mnist-tutorial.txt b/docs/tutorials/tf-mnist-tutorial.txt index 378dca77753..a55ad769d2c 100644 --- a/docs/tutorials/tf-mnist-tutorial.txt +++ b/docs/tutorials/tf-mnist-tutorial.txt @@ -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): @@ -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), ] ) @@ -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()``. @@ -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 `. 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 `. 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``.