Skip to content

doc: update using_tensorflow topic #946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
87df158
doc: refactor overview section per improvement plan
eslesar-aws Jun 19, 2019
90c4b46
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jun 19, 2019
d7807d3
doc: refactor sphinx overview topic
eslesar-aws Jun 24, 2019
2fb1a12
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jun 25, 2019
9276c3c
Update doc/overview.rst
eslesar-aws Jun 26, 2019
ace7929
Update doc/overview.rst
eslesar-aws Jun 26, 2019
98ed2a6
Merge branch 'master' into refactor-tensorflow-general
eslesar-aws Jun 26, 2019
122f066
doc: made changes per feedback comments
eslesar-aws Jun 26, 2019
94d271e
Merge branch 'refactor-tensorflow-general' of https://github.com/esle…
eslesar-aws Jun 26, 2019
79ef51e
Merge branch 'master' into refactor-tensorflow-general
eslesar-aws Jun 28, 2019
9eca3ef
doc: remove duplicate faq section and fixed heading
eslesar-aws Jun 28, 2019
c352a36
Merge branch 'refactor-tensorflow-general' of https://github.com/esle…
eslesar-aws Jun 28, 2019
565ff70
doc: fix heading levels in overview.rst
eslesar-aws Jun 28, 2019
da0868e
doc: update TensorFlow using topic
eslesar-aws Jul 8, 2019
345a860
doc: fix merge conflicts in overview.rst
eslesar-aws Jul 8, 2019
94ccf28
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jul 16, 2019
aa6ef48
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jul 18, 2019
e18384b
doc: Update using_tf.rst to address feedback
eslesar-aws Jul 18, 2019
1ef4b8c
doc: fix comment in conf.py per build log
eslesar-aws Jul 19, 2019
90eebfd
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jul 19, 2019
18fcde1
doc: add newline to conf.py to fix error
eslesar-aws Jul 19, 2019
4b0d181
doc: addressed feedback for PR
eslesar-aws Jul 19, 2019
1fd146d
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jul 19, 2019
8df0760
doc: update conf.py
eslesar-aws Jul 19, 2019
addced4
doc: remove duplicate byom section in overview.rst
eslesar-aws Jul 19, 2019
9c1bba2
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk …
eslesar-aws Jul 19, 2019
f595cab
doc: remove duplicate headings in several rst files
eslesar-aws Jul 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __getattr__(cls, name):
"sphinx.ext.coverage",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -95,3 +96,6 @@ def __getattr__(cls, name):

# autosummary
autosummary_generate = True

# autosectionlabel
autosectionlabel_prefix_document = True
53 changes: 0 additions & 53 deletions doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -826,59 +826,6 @@ A new training job channel, named ``code``, will be added with that S3 URI. Bef

Once the training job begins, the training container will look at the offline input ``code`` channel to install dependencies and run the entry script. This isolates the training container, so no inbound or outbound network calls can be made.

*********
BYO Model
*********

You can also create an endpoint from an existing model rather than training one.
That is, you can bring your own model:

First, package the files for the trained model into a ``.tar.gz`` file, and upload the archive to S3.

Next, create a ``Model`` object that corresponds to the framework that you are using: `MXNetModel <https://sagemaker.readthedocs.io/en/stable/sagemaker.mxnet.html#mxnet-model>`__ or `TensorFlowModel <https://sagemaker.readthedocs.io/en/stable/sagemaker.tensorflow.html#tensorflow-model>`__.

Example code using ``MXNetModel``:

.. code:: python

from sagemaker.mxnet.model import MXNetModel

sagemaker_model = MXNetModel(model_data='s3://path/to/model.tar.gz',
role='arn:aws:iam::accid:sagemaker-role',
entry_point='entry_point.py')

After that, invoke the ``deploy()`` method on the ``Model``:

.. code:: python

predictor = sagemaker_model.deploy(initial_instance_count=1,
instance_type='ml.m4.xlarge')

This returns a predictor the same way an ``Estimator`` does when ``deploy()`` is called. You can now get inferences just like with any other model deployed on Amazon SageMaker.

Git support is also available when you bring your own model, through which you can use inference scripts stored in your
Git repositories. The process is similar to using Git support for training jobs. You can simply provide ``git_config``
when create the ``Model`` object, and let ``entry_point``, ``source_dir`` and ``dependencies`` (if needed) be relative
paths inside the Git repository:

.. code:: python

git_config = {'repo': 'https://github.com/username/repo-with-training-scripts.git',
'branch': 'branch1',
'commit': '4893e528afa4a790331e1b5286954f073b0f14a2'}

sagemaker_model = MXNetModel(model_data='s3://path/to/model.tar.gz',
role='arn:aws:iam::accid:sagemaker-role',
entry_point='inference.py',
source_dir='mxnet',
git_config=git_config)

A full example is available in the `Amazon SageMaker examples repository <https://github.com/awslabs/amazon-sagemaker-examples/tree/master/advanced_functionality/mxnet_mnist_byom>`__.

You can also find this notebook in the **Advanced Functionality** section of the **SageMaker Examples** section in a notebook instance.
For information about using sample notebooks in a SageMaker notebook instance, see `Use Example Notebooks <https://docs.aws.amazon.com/sagemaker/latest/dg/howitworks-nbexamples.html>`__
in the AWS documentation.

*******************
Inference Pipelines
*******************
Expand Down
1,396 changes: 698 additions & 698 deletions doc/using_chainer.rst

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions doc/using_mxnet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ Calling fit

You start your training script by calling ``fit`` on an ``MXNet`` Estimator. ``fit`` takes both required and optional arguments.

Required argument
'''''''''''''''''
fit Required argument
'''''''''''''''''''''

- ``inputs``: This can take one of the following forms: A string
S3 URI, for example ``s3://my-bucket/my-training-data``. In this
Expand All @@ -430,8 +430,8 @@ For example:

.. optional-arguments-1:

Optional arguments
''''''''''''''''''
fit Optional arguments
''''''''''''''''''''''

- ``wait``: Defaults to True, whether to block and wait for the
training script to complete before returning.
Expand Down
Loading