Skip to content

Commit 350442e

Browse files
authored
Merge pull request aws#168 from awslabs/mxnet-nb
Update mxnet.ipynb
2 parents 08acb96 + 984ccb9 commit 350442e

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

examples/mxnet/sagemaker-notebooks/mxnet.ipynb

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,11 @@
8181
"\n",
8282
"### Instantiate and initialize tornasole hook\n",
8383
"\n",
84-
"**NOTE: In order to enable Tornasole functionality while running the script in SageMaker, the hook must be initialized with 'out_dir = /opt/ml/output/tensors'.**\n",
85-
"\n",
8684
"```\n",
8785
" # Create SaveConfig that instructs engine to log graph tensors every 10 steps.\n",
8886
" save_config = SaveConfig(save_interval=10)\n",
8987
" # Create a hook that logs tensors of weights, biases and gradients while training the model.\n",
90-
" tornasole_path = '/opt/ml/output/tensors'\n",
91-
" hook = TornasoleHook(out_dir=output_s3_uri, save_config=save_config)\n",
88+
" hook = TornasoleHook(save_config=save_config)\n",
9289
"```\n",
9390
"\n",
9491
"### Register Tornasole hook to the model before starting of the training.\n",
@@ -105,15 +102,13 @@
105102
"```\n",
106103
"\n",
107104
"#### Set the mode\n",
108-
"Set the mode you are running the job in. This helps you group steps by mode, \n",
109-
"for easier analysis. \n",
110-
"If you do not specify this, it saves steps under a `default` mode.\n",
111-
"\n",
105+
"Tornasole has the concept of modes (TRAIN, EVAL, PREDICT) to separate out different modes of the jobs.\n",
106+
"Set the mode you are running in your job. Every time the mode changes in your job, please set the current mode. This helps you group steps by mode, for easier analysis. Setting the mode is optional but recommended. If you do not specify this, Tornasole saves all steps under a `GLOBAL` mode. \n",
112107
"```\n",
113108
"hook.set_mode(ts.modes.TRAIN)\n",
114109
"```\n",
115110
"\n",
116-
"Refer [DeveloperGuide_MXNet.md](../DeveloperGuide_MXNet.md) for more details on the APIs Tornasole provides to help you save tensors.\n",
111+
"Refer [DeveloperGuide_MXNet.md](../../DeveloperGuide_MXNet.md) for more details on the APIs Tornasole provides to help you save tensors.\n",
117112
"\n",
118113
"\n",
119114
"## SageMaker with Tornasole\n",
@@ -250,7 +245,6 @@
250245
"metadata": {},
251246
"outputs": [],
252247
"source": [
253-
"import boto3\n",
254248
"import sagemaker\n",
255249
"from sagemaker.mxnet import MXNet\n",
256250
"\n",
@@ -270,7 +264,7 @@
270264
"\n",
271265
"The 'entry_point_script' points to the MXNet training script that has the TornasoleHook integrated.\n",
272266
"\n",
273-
"The 'hyperparameters' are the parameters that will be passed to the training script. Please note that the **tornasole_path** parameter is set to be **/opt/ml/output/tensors**. This is **mandatory** when running the training script with SageMaker and Tornasole.\n",
267+
"The 'hyperparameters' are the parameters that will be passed to the training script.\n",
274268
"\n"
275269
]
276270
},
@@ -281,7 +275,7 @@
281275
"outputs": [],
282276
"source": [
283277
"entry_point_script = '../scripts/mnist_gluon_basic_hook_demo.py'\n",
284-
"hyperparameters = {'tornasole_path' : '/opt/ml/output/tensors', 'random_seed' : True, 'num_steps': 6}"
278+
"hyperparameters = {'random_seed' : True, 'num_steps': 6}"
285279
]
286280
},
287281
{
@@ -377,7 +371,7 @@
377371
"outputs": [],
378372
"source": [
379373
"entry_point_script = '../scripts/mnist_gluon_vg_demo.py'\n",
380-
"bad_hyperparameters = {'tornasole_path' : '/opt/ml/output/tensors', 'random_seed' : True, 'num_steps': 33, 'tornasole_frequency' : 30}"
374+
"bad_hyperparameters = {'random_seed' : True, 'num_steps': 33, 'tornasole_frequency' : 30}"
381375
]
382376
},
383377
{

0 commit comments

Comments
 (0)