Accelerate documentation

ここから始めよう!

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.15.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

ここから始めよう!

Accelerateの特定の機能とその活用方法について学習を始める際に、以下のインタラクティブツールをご利用ください。コードの差分、処理内容の説明、さらにドキュメント内でさらに詳しく調べるための有用なリンクをご提供します。

ほとんどのコード例は、Accelerateを何らかの形で統合する前に、以下のPythonコードから始まります:

for batch in dataloader:
    optimizer.zero_grad()
    inputs, targets = batch
    inputs = inputs.to(device)
    targets = targets.to(device)
    outputs = model(inputs)
    loss = loss_function(outputs, targets)
    loss.backward()
    optimizer.step()
    scheduler.step()
Update on GitHub