

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# アルゴリズムスクリプトの環境を定義する
<a name="braket-jobs-script-environment"></a>

Amazon Braket は、アルゴリズムスクリプトのコンテナによって定義された環境をサポートしています。
+ ベースコンテナ (`image_uri` が指定されていない場合のデフォルト)
+ CUDA-Q のコンテナ
+ Tensorflow と PennyLane のコンテナ
+ PyTorch、PennyLane、CUDA-Q のコンテナ

次の表に、コンテナとその付属ライブラリの詳細を示します。


**Amazon Braket コンテナ**  

| タイプ | ベース | CUDA-Q | TensorFlow | PyTorch | 
| --- | --- | --- | --- | --- | 
|   **イメージ URI**   |  292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:latest  |  292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-cudaq-jobs:latest  |  292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-tensorflow-jobs:latest  |  292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-pytorch-jobs:latest  | 
|   **継承ライブラリ**   |  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  | 
|   **追加のライブラリ**   |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/braket/latest/developerguide/braket-jobs-script-environment.html)  | 

オープンソースのコンテナ定義は、[aws/amazon-braket-containers](https://github.com/aws/amazon-braket-containers) で確認およびアクセスできます。ユースケースに一致するコンテナを選択します。Braket で使用可能な AWS リージョン (us-east-1、us-west-1、us-west-2、eu-north-1、eu-west-2) のいずれかを使用できますが、コンテナリージョンはハイブリッドジョブのリージョンと一致する必要があります。ハイブリッドジョブを作成する際、次の 3 つの引数のいずれかをハイブリッドジョブスクリプトの `create(…​)` コールに追加することでコンテナイメージを指定します。Amazon Braket コンテナはインターネット接続を備えているため、実行時に選択したコンテナに追加の依存関係を (起動時間または実行時間を犠牲にして) インストールできます。次の例は、us-west-2 リージョンの場合です。
+  **ベースイメージ:** image\$1uri"292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:latest"
+  **CUDA-Q イメージ:** image\$1uri"292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-cudaq-jobs:latest"
+  **Tensorflow イメージ:** image\$1uri="292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-tensorflow-jobs:latest"
+  **PyTorch イメージ:** image\$1uri="292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-pytorch-jobs:latest"

また、`image-uris` は、Amazon Braket SDK の `retrieve_image()` 関数を使用して取得することもできます。次の例は、us-west-2 からそれらを取得する方法を示しています AWS リージョン。

```
from braket.jobs.image_uris import retrieve_image, Framework

image_uri_base = retrieve_image(Framework.BASE, "us-west-2")
image_uri_cudaq = retrieve_image(Framework.CUDAQ, "us-west-2")
image_uri_tf = retrieve_image(Framework.PL_TENSORFLOW, "us-west-2")
image_uri_pytorch = retrieve_image(Framework.PL_PYTORCH, "us-west-2")
```