Skip to content

Commit 2de24fb

Browse files
Merge branch 'master' into local_pull
2 parents 06cc963 + c32dec0 commit 2de24fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+5034
-604
lines changed

.pylintrc

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[MASTER]
2+
3+
ignore=
4+
tensorflow_serving
5+
6+
[MESSAGES CONTROL]
7+
8+
disable=
9+
C, # convention
10+
R, # refactor
11+
too-many-arguments, # We should fix the offending ones soon.
12+
too-many-lines, # Some files are too big, we should fix this too
13+
too-few-public-methods,
14+
too-many-instance-attributes,
15+
too-many-locals,
16+
len-as-condition, # Nice to have in the future
17+
bad-indentation,
18+
line-too-long, # We let Flake8 take care of this
19+
logging-format-interpolation,
20+
useless-object-inheritance, # We still support python2 so inheriting from object is ok
21+
invalid-name,
22+
import-error,
23+
logging-not-lazy,
24+
fixme,
25+
no-self-use,
26+
attribute-defined-outside-init,
27+
protected-access,
28+
invalid-all-object,
29+
arguments-differ,
30+
abstract-method,
31+
signature-differs
32+
33+
[REPORTS]
34+
# Set the output format. Available formats are text, parseable, colorized, msvs
35+
# (visual studio) and html
36+
output-format=colorized
37+
38+
# Tells whether to display a full report or only the messages
39+
# CHANGE: No report.
40+
reports=no
41+
42+
[FORMAT]
43+
# Maximum number of characters on a single line.
44+
max-line-length=100
45+
# Maximum number of lines in a module
46+
#max-module-lines=1000
47+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
48+
indent-string=' '
49+
50+
[BASIC]
51+
52+
# Required attributes for module, separated by a comma
53+
#required-attributes=
54+
# List of builtins function names that should not be used, separated by a comma.
55+
# XXX: Should we ban map() & filter() for list comprehensions?
56+
# exit & quit are for the interactive interpreter shell only.
57+
# https://docs.python.org/3/library/constants.html#constants-added-by-the-site-module
58+
bad-functions=
59+
apply,
60+
exit,
61+
input,
62+
quit,
63+
64+
[SIMILARITIES]
65+
# Minimum lines number of a similarity.
66+
min-similarity-lines=5
67+
# Ignore comments when computing similarities.
68+
ignore-comments=yes
69+
# Ignore docstrings when computing similarities.
70+
ignore-docstrings=yes
71+
72+
[VARIABLES]
73+
# Tells whether we should check for unused import in __init__ files.
74+
init-import=no
75+
# A regular expression matching the beginning of the name of dummy variables
76+
# (i.e. not used).
77+
dummy-variables-rgx=_|unused_
78+
79+
# List of additional names supposed to be defined in builtins. Remember that
80+
# you should avoid to define new builtins when possible.
81+
#additional-builtins=
82+
83+
[LOGGING]
84+
# Apply logging string format checks to calls on these modules.
85+
logging-modules=
86+
logging
87+
88+
[TYPECHECK]
89+
ignored-modules=
90+
distutils

CHANGELOG.rst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,44 @@
22
CHANGELOG
33
=========
44

5-
1.13.1dev
5+
1.14.3-dev
66
======
77

8+
* bug-fix: Changes to use correct S3 bucket and time range for dataframes in TrainingJobAnalytics.
9+
* bug-fix: Local Mode: correctly handle the case where the model output folder doesn't exist yet
10+
* feature: Add APIs to export Airflow training and tuning config
11+
* doc-fix: Fix typos in tensorflow serving documentation
12+
* doc-fix: Add estimator base classes to API docs
13+
* feature: HyperparameterTuner: add support for Automatic Model Tuning's Warm Start Jobs
814
* enhancement: Local Mode: add explicit pull for serving
915

16+
1.14.2
17+
======
18+
19+
* bug-fix: support ``CustomAttributes`` argument in local mode ``invoke_endpoint`` requests
20+
* enhancement: add ``content_type`` parameter to ``sagemaker.tensorflow.serving.Predictor``
21+
* doc-fix: add TensorFlow Serving Container docs
22+
* doc-fix: fix rendering error in README.rst
23+
* enhancement: Local Mode: support optional input channels
24+
* build: added pylint
25+
* build: upgrade docker-compose to 1.23
26+
* enhancement: Frameworks: update warning for not setting framework_version as we aren't planning a breaking change anymore
27+
* enhancement: Session: remove hardcoded 'training' from job status error message
28+
* bug-fix: Updated Cloudwatch namespace for metrics in TrainingJobsAnalytics
29+
* bug-fix: Changes to use correct s3 bucket and time range for dataframes in TrainingJobAnalytics.
30+
* enhancement: Remove MetricDefinition lookup via tuning job in TrainingJobAnalytics
31+
32+
1.14.1
33+
======
34+
35+
* feature: Estimators: add support for Amazon Object2Vec algorithm
36+
37+
1.14.0
38+
======
39+
40+
* feature: add support for sagemaker-tensorflow-serving container
41+
* feature: Estimator: make input channels optional
42+
1043
1.13.0
1144
======
1245

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ If your bring-your-own case requires different settings, you can create your own
290290
Here's an example of how to use incremental training:
291291
292292
.. code:: python
293+
293294
# Configure an estimator
294295
estimator = sagemaker.estimator.Estimator(training_image,
295296
role,
@@ -394,7 +395,7 @@ Amazon SageMaker provides several built-in machine learning algorithms that you
394395
The full list of algorithms is available at: https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html
395396
396397
The SageMaker Python SDK includes estimator wrappers for the AWS K-means, Principal Components Analysis (PCA), Linear Learner, Factorization Machines,
397-
Latent Dirichlet Allocation (LDA), Neural Topic Model (NTM) Random Cut Forest and k-nearest neighbors (k-NN) algorithms.
398+
Latent Dirichlet Allocation (LDA), Neural Topic Model (NTM), Random Cut Forest, k-nearest neighbors (k-NN), and Object2Vec algorithms.
398399
399400
For more information, see `AWS SageMaker Estimators and Models`_.
400401

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __getattr__(cls, name):
3232
'numpy', 'scipy', 'scipy.sparse']
3333
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
3434

35-
version = '1.11.3'
35+
version = '1.14.0'
3636
project = u'sagemaker'
3737

3838
# Add any Sphinx extension module names here, as strings. They can be extensions

doc/estimators.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
Estimators
2-
--------------------
2+
----------
33

44
A high level interface for SageMaker training
55

6+
.. autoclass:: sagemaker.estimator.EstimatorBase
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
10+
:inherited-members:
11+
612
.. autoclass:: sagemaker.estimator.Estimator
713
:members:
814
:undoc-members:
915
:show-inheritance:
1016
:inherited-members:
17+
18+
.. autoclass:: sagemaker.estimator.Framework
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
:inherited-members:

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def read(fname):
5353
],
5454

5555
# Declare minimal set for installation
56-
install_requires=['boto3>=1.4.8', 'numpy>=1.9.0', 'protobuf>=3.1', 'scipy>=0.19.0',
57-
'urllib3 >=1.21, <1.23',
58-
'PyYAML>=3.2', 'protobuf3-to-dict>=0.1.5', 'docker-compose>=1.21.0'],
56+
install_requires=['boto3>=1.9.38', 'numpy>=1.9.0', 'protobuf>=3.1', 'scipy>=0.19.0',
57+
'urllib3 >=1.21', 'PyYAML>=3.2', 'protobuf3-to-dict>=0.1.5',
58+
'docker-compose>=1.23.0'],
5959

6060
extras_require={
6161
'test': ['tox', 'flake8', 'pytest', 'pytest-cov', 'pytest-xdist',

src/sagemaker/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from sagemaker.amazon.randomcutforest import (RandomCutForest, RandomCutForestModel, # noqa: F401
2424
RandomCutForestPredictor)
2525
from sagemaker.amazon.knn import KNN, KNNModel, KNNPredictor # noqa: F401
26+
from sagemaker.amazon.object2vec import Object2Vec, Object2VecModel # noqa: F401
2627

2728
from sagemaker.analytics import TrainingJobAnalytics, HyperparameterTuningJobAnalytics # noqa: F401
2829
from sagemaker.local.local_session import LocalSession # noqa: F401
@@ -35,4 +36,4 @@
3536
from sagemaker.session import s3_input # noqa: F401
3637
from sagemaker.session import get_execution_role # noqa: F401
3738

38-
__version__ = '1.13.0'
39+
__version__ = '1.14.2'

src/sagemaker/amazon/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Amazon SageMaker provides several built-in machine learning algorithms that you
77

88
The full list of algorithms is available on the AWS website: https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html
99

10-
SageMaker Python SDK includes Estimator wrappers for the AWS K-means, Principal Components Analysis(PCA), Linear Learner, Factorization Machines, Latent Dirichlet Allocation(LDA), Neural Topic Model(NTM), Random Cut Forest algorithms and k-nearest neighbors (k-NN).
10+
SageMaker Python SDK includes Estimator wrappers for the AWS K-means, Principal Components Analysis(PCA), Linear Learner, Factorization Machines, Latent Dirichlet Allocation(LDA), Neural Topic Model(NTM), Random Cut Forest algorithms, k-nearest neighbors (k-NN) and Object2Vec.
1111

1212
Definition and usage
1313
~~~~~~~~~~~~~~~~~~~~

src/sagemaker/amazon/amazon_estimator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
import json
1616
import logging
1717
import tempfile
18+
1819
from six.moves.urllib.parse import urlparse
20+
1921
from sagemaker.amazon import validation
2022
from sagemaker.amazon.hyperparameter import Hyperparameter as hp # noqa
2123
from sagemaker.amazon.common import write_numpy_to_dense_tensor
@@ -32,6 +34,8 @@ class AmazonAlgorithmEstimatorBase(EstimatorBase):
3234

3335
feature_dim = hp('feature_dim', validation.gt(0), data_type=int)
3436
mini_batch_size = hp('mini_batch_size', validation.gt(0), data_type=int)
37+
repo_name = None
38+
repo_version = None
3539

3640
def __init__(self, role, train_instance_count, train_instance_type, data_location=None, **kwargs):
3741
"""Initialize an AmazonAlgorithmEstimatorBase.
@@ -263,7 +267,7 @@ def upload_numpy_to_s3_shards(num_shards, s3, bucket, key_prefix, array, labels=
263267
[{'prefix': 's3://{}/{}'.format(bucket, key_prefix)}] + uploaded_files)
264268
s3.Object(bucket, manifest_key).put(Body=manifest_str.encode('utf-8'))
265269
return "s3://{}/{}".format(bucket, manifest_key)
266-
except Exception as ex:
270+
except Exception as ex: # pylint: disable=broad-except
267271
try:
268272
for file in uploaded_files:
269273
s3.Object(bucket, key_prefix + file).delete()
@@ -280,7 +284,7 @@ def registry(region_name, algorithm=None):
280284
https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/amazon
281285
"""
282286
if algorithm in [None, "pca", "kmeans", "linear-learner", "factorization-machines", "ntm",
283-
"randomcutforest", "knn"]:
287+
"randomcutforest", "knn", "object2vec"]:
284288
account_id = {
285289
"us-east-1": "382416733822",
286290
"us-east-2": "404615174143",

src/sagemaker/amazon/kmeans.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ def _prepare_for_training(self, records, mini_batch_size=5000, job_name=None):
121121

122122
def hyperparameters(self):
123123
"""Return the SageMaker hyperparameters for training this KMeans Estimator"""
124-
hp = dict(force_dense='True') # KMeans requires this hp to fit on Record objects
125-
hp.update(super(KMeans, self).hyperparameters())
126-
return hp
124+
hp_dict = dict(force_dense='True') # KMeans requires this hp to fit on Record objects
125+
hp_dict.update(super(KMeans, self).hyperparameters())
126+
return hp_dict
127127

128128

129129
class KMeansPredictor(RealTimePredictor):

0 commit comments

Comments
 (0)