Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-mintlify-style-consistency-1776283399.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
W&B は、Databricks 環境での W&B Jupyter ノートブック体験をカスタマイズすることにより、Databricks と統合します。
Databricks の設定
-
クラスターに wandb をインストール
クラスター設定に移動し、クラスターを選択し、Libraries をクリックします。Install New をクリックし、PyPI を選択してパッケージ
wandb を追加します。
-
認証の設定
あなたの W&B アカウントを認証するために、ノートブックが照会できる Databricks シークレットを追加することができます。
# databricks cli をインストール
pip install databricks-cli
# databricks UIからトークンを生成
databricks configure --token
# 2つのコマンドのいずれかでスコープを作成します(databricksでセキュリティ機能が有効かどうかによります):
# セキュリティ追加機能あり
databricks secrets create-scope --scope wandb
# セキュリティ追加機能なし
databricks secrets create-scope --scope wandb --initial-manage-principal users
# こちらから api_key を追加します: https://app.wandb.ai/authorize
databricks secrets put --scope wandb --key api_key
簡単な例
import os
import wandb
api_key = dbutils.secrets.get("wandb", "api_key")
wandb.login(key=api_key)
wandb.init()
wandb.log({"foo": 1})
Sweeps
ノートブックが wandb.sweep() または wandb.agent() を使用しようとする際に必要な設定(暫定的)です。
import os
# これらは将来的には不要になります
os.environ["WANDB_ENTITY"] = "my-entity"
os.environ["WANDB_PROJECT"] = "my-project-that-exists"