diff --git a/src/sagemaker/chainer/estimator.py b/src/sagemaker/chainer/estimator.py index 9af67dd450..c8019a55f2 100644 --- a/src/sagemaker/chainer/estimator.py +++ b/src/sagemaker/chainer/estimator.py @@ -111,13 +111,20 @@ def __init__( 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. .. - admonition:: Examples + py_version. It can be an ECR url or dockerhub image and tag. + + Examples + * ``123412341234.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0`` + * ``custom-image:latest`` - 123.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0 - custom-image:latest. **kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ if framework_version is None: logger.warning(empty_framework_version_warning(CHAINER_VERSION, self.LATEST_VERSION)) diff --git a/src/sagemaker/chainer/model.py b/src/sagemaker/chainer/model.py index df540dd8b1..74a9072b4a 100644 --- a/src/sagemaker/chainer/model.py +++ b/src/sagemaker/chainer/model.py @@ -1,4 +1,4 @@ -# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -93,8 +93,14 @@ def __init__( model_server_workers (int): Optional. The number of worker processes used by the inference server. If None, server will use one worker per vCPU. - **kwargs: Keyword arguments passed to the ``FrameworkModel`` - initializer. + **kwargs: Keyword arguments passed to the + :class:`~sagemaker.model.FrameworkModel` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(ChainerModel, self).__init__( model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs diff --git a/src/sagemaker/mxnet/estimator.py b/src/sagemaker/mxnet/estimator.py index 4293b8d898..6e47e8640c 100644 --- a/src/sagemaker/mxnet/estimator.py +++ b/src/sagemaker/mxnet/estimator.py @@ -90,15 +90,22 @@ def __init__( 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. + * ``123412341234.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). To have parameter servers launched for training, set this value to be ``{'parameter_server': {'enabled': True}}``. **kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ if framework_version is None: logger.warning(empty_framework_version_warning(MXNET_VERSION, self.LATEST_VERSION)) @@ -161,8 +168,10 @@ def create_model( role from the Estimator will be used. vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the model. Default: use subnets and security groups from this Estimator. + * 'Subnets' (list[str]): List of subnet ids. * 'SecurityGroupIds' (list[str]): List of security group ids. + entry_point (str): Path (absolute or relative) to the local Python source file which should be executed as the entry point to training. If not specified, the training entry point is used. @@ -175,10 +184,13 @@ def create_model( image_name (str): If specified, the estimator will use this image for 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. - **kwargs: Additional kwargs passed to the MXNetModel constructor. + * ``123412341234.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0`` + * ``custom-image:latest`` + + **kwargs: Additional kwargs passed to the :class:`~sagemaker.mxnet.model.MXNetModel` + constructor. Returns: sagemaker.mxnet.model.MXNetModel: A SageMaker ``MXNetModel`` object. diff --git a/src/sagemaker/mxnet/model.py b/src/sagemaker/mxnet/model.py index 26b6a6ffa7..ced3f0865c 100644 --- a/src/sagemaker/mxnet/model.py +++ b/src/sagemaker/mxnet/model.py @@ -1,4 +1,4 @@ -# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -96,6 +96,12 @@ def __init__( worker per vCPU. **kwargs: Keyword arguments passed to the ``FrameworkModel`` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(MXNetModel, self).__init__( model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs diff --git a/src/sagemaker/pytorch/estimator.py b/src/sagemaker/pytorch/estimator.py index ead892a0ce..118cb2594c 100644 --- a/src/sagemaker/pytorch/estimator.py +++ b/src/sagemaker/pytorch/estimator.py @@ -89,11 +89,19 @@ def __init__( 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. + * ``123412341234.dkr.ecr.us-west-2.amazonaws.com/my-custom-image:1.0`` + * ``custom-image:latest`` + **kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ if framework_version is None: logger.warning(empty_framework_version_warning(PYTORCH_VERSION, PYTORCH_VERSION)) @@ -146,7 +154,8 @@ def create_model( dependencies (list[str]): A list of paths to directories (absolute or relative) with any additional libraries that will be exported to the container. If not specified, the dependencies from training are used. - **kwargs: Additional kwargs passed to the PyTorchModel constructor. + **kwargs: Additional kwargs passed to the :class:`~sagemaker.pytorch.model.PyTorchModel` + constructor. Returns: sagemaker.pytorch.model.PyTorchModel: A SageMaker ``PyTorchModel`` diff --git a/src/sagemaker/pytorch/model.py b/src/sagemaker/pytorch/model.py index d886539516..f1b68a28c1 100644 --- a/src/sagemaker/pytorch/model.py +++ b/src/sagemaker/pytorch/model.py @@ -1,4 +1,4 @@ -# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -97,6 +97,12 @@ def __init__( worker per vCPU. **kwargs: Keyword arguments passed to the ``FrameworkModel`` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(PyTorchModel, self).__init__( model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs diff --git a/src/sagemaker/rl/estimator.py b/src/sagemaker/rl/estimator.py index 0947d4e653..73af547879 100644 --- a/src/sagemaker/rl/estimator.py +++ b/src/sagemaker/rl/estimator.py @@ -131,6 +131,12 @@ def __init__( don't use an Amazon algorithm. **kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ self._validate_images_args(toolkit, toolkit_version, framework, image_name) @@ -174,8 +180,10 @@ def create_model( role from the Estimator will be used. vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the model. Default: use subnets and security groups from this Estimator. + * 'Subnets' (list[str]): List of subnet ids. * 'SecurityGroupIds' (list[str]): List of security group ids. + entry_point (str): Path (absolute or relative) to the Python source file which should be executed as the entry point for MXNet hosting. This should be compatible with Python 3.5 (default: @@ -190,18 +198,20 @@ def create_model( folders will be copied to SageMaker in the same folder where the entry_point is copied. If the ```source_dir``` points to S3, code will be uploaded and the S3 location will be used instead. - **kwargs: Additional kwargs passed to the FrameworkModel constructor. + **kwargs: Additional kwargs passed to the :class:`~sagemaker.model.FrameworkModel` + constructor. Returns: sagemaker.model.FrameworkModel: Depending on input parameters returns one of the following: - * sagemaker.model.FrameworkModel - in case image_name was specified + * :class:`~sagemaker.model.FrameworkModel` - if ``image_name`` was specified on the estimator; - * sagemaker.mxnet.MXNetModel - if image_name wasn't specified and - MXNet was used as RL backend; - * sagemaker.tensorflow.serving.Model - if image_name wasn't specified and - TensorFlow was used as RL backend. + * :class:`~sagemaker.mxnet.MXNetModel` - if ``image_name`` wasn't specified and + MXNet was used as the RL backend; + * :class:`~sagemaker.tensorflow.serving.Model` - if ``image_name`` wasn't specified + and TensorFlow was used as the RL backend. + Raises: ValueError: If image_name was not specified and framework enum is not valid. """ diff --git a/src/sagemaker/sklearn/estimator.py b/src/sagemaker/sklearn/estimator.py index 1c9c0ae16d..f4fa08b782 100644 --- a/src/sagemaker/sklearn/estimator.py +++ b/src/sagemaker/sklearn/estimator.py @@ -90,6 +90,12 @@ def __init__( custom-image:latest. **kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ # SciKit-Learn does not support distributed training or training on GPU instance types. # Fail fast. diff --git a/src/sagemaker/sklearn/model.py b/src/sagemaker/sklearn/model.py index d18be45770..5cba539e21 100644 --- a/src/sagemaker/sklearn/model.py +++ b/src/sagemaker/sklearn/model.py @@ -1,4 +1,4 @@ -# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -96,6 +96,12 @@ def __init__( worker per vCPU. **kwargs: Keyword arguments passed to the ``FrameworkModel`` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(SKLearnModel, self).__init__( model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs diff --git a/src/sagemaker/tensorflow/estimator.py b/src/sagemaker/tensorflow/estimator.py index 39330c798f..3ceb3d1dae 100644 --- a/src/sagemaker/tensorflow/estimator.py +++ b/src/sagemaker/tensorflow/estimator.py @@ -279,6 +279,12 @@ def __init__( } **kwargs: Additional kwargs passed to the Framework constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ if framework_version is None: logger.warning(fw.empty_framework_version_warning(TF_VERSION, self.LATEST_VERSION)) @@ -551,8 +557,8 @@ def create_model( If not specified and ``endpoint_type`` is 'tensorflow-serving', ``dependencies`` is set to ``None``. If ``endpoint_type`` is also ``None``, then the dependencies from training are used. - **kwargs: Additional kwargs passed to ``sagemaker.tensorflow.serving.Model`` constructor - and ``sagemaker.tensorflow.model.TensorFlowModel`` constructor. + **kwargs: Additional kwargs passed to :class:`~sagemaker.tensorflow.serving.Model` + and :class:`~sagemaker.tensorflow.model.TensorFlowModel` constructors. Returns: sagemaker.tensorflow.model.TensorFlowModel or sagemaker.tensorflow.serving.Model: A diff --git a/src/sagemaker/tensorflow/model.py b/src/sagemaker/tensorflow/model.py index bb90c30e54..b3eec79aff 100644 --- a/src/sagemaker/tensorflow/model.py +++ b/src/sagemaker/tensorflow/model.py @@ -1,4 +1,4 @@ -# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -94,6 +94,12 @@ def __init__( worker per vCPU. **kwargs: Keyword arguments passed to the ``FrameworkModel`` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(TensorFlowModel, self).__init__( model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs diff --git a/src/sagemaker/tensorflow/serving.py b/src/sagemaker/tensorflow/serving.py index 10f5b9778a..40a8f55a90 100644 --- a/src/sagemaker/tensorflow/serving.py +++ b/src/sagemaker/tensorflow/serving.py @@ -1,4 +1,4 @@ -# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -165,6 +165,12 @@ def __init__( SageMaker ``Session``. If specified, ``deploy()`` returns the result of invoking this function on the created endpoint name. **kwargs: Keyword arguments passed to the ``Model`` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(Model, self).__init__( model_data=model_data, diff --git a/src/sagemaker/xgboost/estimator.py b/src/sagemaker/xgboost/estimator.py index bf81b7c6c7..e2dc9c25d4 100644 --- a/src/sagemaker/xgboost/estimator.py +++ b/src/sagemaker/xgboost/estimator.py @@ -100,6 +100,12 @@ def __init__( custom-image:latest. **kwargs: Additional kwargs passed to the :class:`~sagemaker.estimator.Framework` constructor. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.estimator.Framework` and + :class:`~sagemaker.estimator.EstimatorBase`. """ super(XGBoost, self).__init__( entry_point, source_dir, hyperparameters, image_name=image_name, **kwargs diff --git a/src/sagemaker/xgboost/model.py b/src/sagemaker/xgboost/model.py index 2128aef8cf..012abd1785 100644 --- a/src/sagemaker/xgboost/model.py +++ b/src/sagemaker/xgboost/model.py @@ -1,4 +1,4 @@ -# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -87,6 +87,12 @@ def __init__( model_server_workers (int): Optional. The number of worker processes used by the inference server. If None, server will use one worker per vCPU. **kwargs: Keyword arguments passed to the ``FrameworkModel`` initializer. + + .. tip:: + + You can find additional parameters for initializing this class at + :class:`~sagemaker.model.FrameworkModel` and + :class:`~sagemaker.model.Model`. """ super(XGBoostModel, self).__init__( model_data, image, role, entry_point, predictor_cls=predictor_cls, **kwargs