Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __getattr__(cls, name):
html_theme = 'default'
else:
html_theme = 'haiku'
html_static_path = ['_static']
html_static_path = []
htmlhelp_basename = '%sdoc' % project

# Example configuration for intersphinx: refer to the Python standard library.
Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/amazon/knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(self, role, train_instance_count, train_instance_type, k, sample_si
KNN are documented below.
For further information on the AWS KNN algorithm,
please consult AWS technical documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/knn.html

Args:
role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker training jobs and
APIs that create Amazon SageMaker endpoints use this role to access
Expand Down
11 changes: 6 additions & 5 deletions src/sagemaker/mxnet/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ def __init__(self, entry_point, source_dir=None, hyperparameters=None, py_versio
For convenience, this accepts other types for keys and values, but ``str()`` will be called
to convert them before training.
py_version (str): Python version you want to use for executing your model training code (default: 'py2').
One of 'py2' or 'py3'.
One of 'py2' or 'py3'.
framework_version (str): MXNet version you want to use for executing your model training code.
List of supported versions https://github.com/aws/sagemaker-python-sdk#mxnet-sagemaker-estimators
image_name (str): If specified, the estimator will use this image for training and hosting, instead of
selecting the appropriate SageMaker official image based on framework_version and py_version. It can
be an ECR url or dockerhub image and tag.
Examples:
123.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0
custom-image:latest.

Examples:
123.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0
custom-image:latest.
distributions (dict): A dictionary with information on how to run distributed training
(default: None).
**kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor.
Expand Down Expand Up @@ -126,7 +127,7 @@ def _prepare_init_params_from_job_description(cls, job_details, model_channel_na
model_channel_name (str): Name of the channel where pre-trained model data will be downloaded.

Returns:
dictionary: The transformed init_params
dictionary: The transformed init_params

"""
init_params = super(MXNet, cls)._prepare_init_params_from_job_description(job_details, model_channel_name)
Expand Down
15 changes: 10 additions & 5 deletions src/sagemaker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def compile_model(self, input_model_config, output_model_config, role,

Args:
input_model_config (dict): the trained model and the Amazon S3 location where it is stored.
output_model_config (dict): - Identifies the Amazon S3 location where you want Amazon SageMaker Neo to save
output_model_config (dict): Identifies the Amazon S3 location where you want Amazon SageMaker Neo to save
the results of compilation job
role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker Neo compilation jobs use this
role to access model artifacts. You must grant sufficient permissions to this role.
Expand Down Expand Up @@ -550,6 +550,7 @@ def create_model(self, name, role, container_defs, vpc_config=None,
the inference code. Amazon SageMaker uses this information to deploy the
model in Amazon SageMaker. This method can also be used to create a Model for an Inference Pipeline
if you pass the list of container definitions through the containers parameter.

Args:
name (str): Name of the Amazon SageMaker ``Model`` to create.
role (str): An AWS IAM role (either name or full ARN). The Amazon SageMaker training jobs and APIs
Expand Down Expand Up @@ -1177,6 +1178,7 @@ def logs_for_job(self, job_name, wait=False, poll=10): # noqa: C901 - suppress

def container_def(image, model_data_url=None, env=None):
"""Create a definition for executing a container as part of a SageMaker model.

Args:
image (str): Docker image to run for this container.
model_data_url (str): S3 URI of data required by this container,
Expand Down Expand Up @@ -1286,19 +1288,22 @@ def __init__(self, s3_data, distribution='FullyReplicated', compression=None,
``s3_data`` will be used to train. If 'ManifestFile' or 'AugmentedManifestFile', then ``s3_data``
defines a single s3 manifest file or augmented manifest file (respectively), listing the s3 data to
train on. Both the ManifestFile and AugmentedManifestFile formats are described in the SageMaker API
documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/API_S3DataSource.html
documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/API_S3DataSource.html
input_mode (str): Optional override for this channel's input mode (default: None). By default, channels will
use the input mode defined on ``sagemaker.estimator.EstimatorBase.input_mode``, but they will ignore
that setting if this parameter is set.
* None - Amazon SageMaker will use the input mode specified in the ``Estimator``.
* 'File' - Amazon SageMaker copies the training dataset from the S3 location to a local directory.
* 'Pipe' - Amazon SageMaker streams data directly from S3 to the container via a Unix-named pipe.

* None - Amazon SageMaker will use the input mode specified in the ``Estimator``.
* 'File' - Amazon SageMaker copies the training dataset from the S3 location to a local directory.
* 'Pipe' - Amazon SageMaker streams data directly from S3 to the container via a Unix-named pipe.

attribute_names (list[str]): A list of one or more attribute names to use that are found in a specified
AugmentedManifestFile.
shuffle_config (ShuffleConfig): If specified this configuration enables shuffling on this channel. See the
SageMaker API documentation for more info:
https://docs.aws.amazon.com/sagemaker/latest/dg/API_ShuffleConfig.html
"""

self.config = {
'DataSource': {
'S3DataSource': {
Expand Down
4 changes: 3 additions & 1 deletion src/sagemaker/sparkml/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, endpoint, sagemaker_session=None):
Initializes a SparkMLPredictor which should be used with SparkMLModel to perform predictions against SparkML
models serialized via MLeap. The response is returned in text/csv format which is the default response format
for SparkML Serving container.

Args:
endpoint (str): The name of the endpoint to perform inference on.
sagemaker_session (sagemaker.session.Session): Session object which manages interactions with
Expand All @@ -56,7 +57,8 @@ class SparkMLModel(Model):
"""

def __init__(self, model_data, role=None, spark_version=2.2, sagemaker_session=None, **kwargs):
"""Initialize a SparkMLModel..
"""Initialize a SparkMLModel.

Args:
model_data (str): The S3 location of a SageMaker model data ``.tar.gz`` file. For SparkML, this will be the
output that has been produced by the Spark job after serializing the Model via MLeap.
Expand Down
31 changes: 22 additions & 9 deletions src/sagemaker/tensorflow/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ class TensorFlow(Framework):
def __init__(self, training_steps=None, evaluation_steps=None, checkpoint_path=None, py_version='py2',
framework_version=None, model_dir=None, requirements_file='', image_name=None,
script_mode=False, distributions=None, **kwargs):
"""Initialize an ``TensorFlow`` estimator.
"""Initialize a ``TensorFlow`` estimator.

Args:
training_steps (int): Perform this many steps of training. `None`, the default means train forever.
evaluation_steps (int): Perform this many steps of evaluation. `None`, the default means that evaluation
Expand All @@ -195,26 +196,36 @@ def __init__(self, training_steps=None, evaluation_steps=None, checkpoint_path=N
image_name (str): If specified, the estimator will use this image for training and hosting, instead of
selecting the appropriate SageMaker official image based on framework_version and py_version. It can
be an ECR url or dockerhub image and tag.
Examples:
123.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0
custom-image:latest.

Examples:
123.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0
custom-image:latest.
script_mode (bool): If set to True will the estimator will use the Script Mode containers (default: False).
This will be ignored if py_version is set to 'py3'.
distributions (dict): A dictionary with information on how to run distributed training
(default: None). Currently we support distributed training with parameter servers and MPI. To enable
parameter server use the following setup:
(default: None). Currently we support distributed training with parameter servers and MPI.
To enable parameter server use the following setup:

.. code:: python

{
'parameter_server':
{
'enabled': True
}
}

To enable MPI:

.. code:: python

{
'mpi':
{
'enabled': True
}
}

**kwargs: Additional kwargs passed to the Framework constructor.
"""
if framework_version is None:
Expand Down Expand Up @@ -281,13 +292,15 @@ def fit(self, inputs=None, wait=True, logs=True, job_name=None, run_tensorboard_
Args:
inputs (str or dict or sagemaker.session.s3_input): Information about the training data.
This can be one of three types:
(str) - the S3 location where training data is saved.
(dict[str, str] or dict[str, sagemaker.session.s3_input]) - If using multiple channels for

* (str) - the S3 location where training data is saved.
* (dict[str, str] or dict[str, sagemaker.session.s3_input]) - If using multiple channels for
training data, you can specify a dict mapping channel names
to strings or :func:`~sagemaker.session.s3_input` objects.
(sagemaker.session.s3_input) - channel configuration for S3 data sources that can provide
* (sagemaker.session.s3_input) - channel configuration for S3 data sources that can provide
additional information as well as the path to the training dataset.
See :func:`sagemaker.session.s3_input` for full details.

wait (bool): Whether the call should wait until the job completes (default: True).
logs (bool): Whether to show the logs produced by the job.
Only meaningful when wait is True (default: True).
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/tensorflow/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@


class TensorFlowPredictor(RealTimePredictor):
"""A ``RealTimePredictor`` for inference against TensorFlow ``Endpoint``s.
"""A ``RealTimePredictor`` for inference against TensorFlow endpoint.

This is able to serialize Python lists, dictionaries, and numpy arrays to multidimensional tensors for MXNet
This is able to serialize Python lists, dictionaries, and numpy arrays to multidimensional tensors for
inference"""
def __init__(self, endpoint_name, sagemaker_session=None):
"""Initialize an ``TensorFlowPredictor``.
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/workflow/airflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,7 @@ def model_config_from_estimator(instance_type, estimator, task_id, task_type, ro

Returns:
dict: Model config that can be directly used by SageMakerModelOperator in Airflow. It can also be part
of the config used by SageMakerEndpointOperator.
SageMakerTransformOperator in Airflow.
of the config used by SageMakerEndpointOperator in Airflow.
"""
update_estimator_from_task(estimator, task_id, task_type)
if isinstance(estimator, sagemaker.estimator.Estimator):
Expand Down