You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just found a SM_HPS environmental variable that dumps the original hyperparameters as
a json string. This helps preserve types and is definitely worth mentioning!
Btw, `type=json.loads` seems to be the correct grammar (and `type=dict` causes errors).
See example https://stackoverflow.com/questions/7625786/type-dict-in-argparse-add-argument
Copy file name to clipboardExpand all lines: src/sagemaker/mxnet/README.rst
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,7 @@ The training script is very similar to a training script you might run outside o
55
55
These artifacts are compressed and uploaded to S3 to an S3 bucket with the same prefix as the model artifacts.
56
56
* ``SM_CHANNEL_XXXX``: A string that represents the path to the directory that contains the input data for the specified channel.
57
57
For example, if you specify two input channels in the MXNet estimator's ``fit`` call, named 'train' and 'test', the environment variables ``SM_CHANNEL_TRAIN`` and ``SM_CHANNEL_TEST`` are set.
58
+
* ``SM_HPS``: A json dump of the hyperparameters preserving json types (boolean, integer, etc.)
58
59
59
60
For the exhaustive list of available environment variables, see the `SageMaker Containers documentation <https://github.com/aws/sagemaker-containers#list-of-provided-environment-variables-by-sagemaker-containers>`__.
60
61
@@ -66,6 +67,7 @@ For example, a training script might start with the following:
66
67
67
68
import argparse
68
69
import os
70
+
import json
69
71
70
72
if__name__=='__main__':
71
73
@@ -76,6 +78,9 @@ For example, a training script might start with the following:
0 commit comments