

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 示例笔记本
<a name="train-remote-decorator-examples"></a>

您可以将现有工作空间环境中的训练代码以及任何相关的数据处理代码和数据集转换为 SageMaker 训练作业。以下笔记本向您展示了如何使用 XGBoost 算法和 Hugging Face 针对图像分类问题自定义环境、作业设置等。

[quick\$1start 笔记本](https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker-remote-function/quick_start/quick_start.ipynb)包含以下代码示例：
+ 如何使用配置文件自定义作业设置。
+ 如何异步将 Python 函数作为作业进行调用。
+ 如何通过引入其他依赖项来自定义作业运行时环境。
+ 如何将本地依赖项与 @remote 函数方法结合使用。

以下笔记本提供了针对不同的机器学习问题类型和实现的其他代码示例。
+ 要查看使用 @remote 装饰器解决图像分类问题的代码示例，请打开 [pytorch\$1mnist.ipynb](https://github.com/aws/amazon-sagemaker-examples/tree/main/sagemaker-remote-function/pytorch_mnist_sample_notebook) 笔记本。此分类问题使用修改后的美国国家标准与技术研究院 (MNIST) 示例数据集来识别手写数字。
+ 要查看有关使用 @remote 装饰器解决与脚本相关的上一个图像分类问题的代码示例，请参阅 Pytorch MNIST 示例脚本 [train.py](https://github.com/aws/amazon-sagemaker-examples/tree/main/sagemaker-remote-function/pytorch_mnist_sample_script)。
+ 要查看该 XGBoost 算法是如何使用 @remote 装饰器实现的：打开 [xg](https://github.com/aws/amazon-sagemaker-examples/tree/main/sagemaker-remote-function/xgboost_abalone) boost\$1abalone.ipynb 笔记本。
+ 要了解 Hugging Face 如何与 @remote 装饰器集成，请打开 [huggingface.ipynb](https://github.com/aws/amazon-sagemaker-examples/tree/main/sagemaker-remote-function/huggingface_text_classification) 笔记本。