0Pricing
Deep Learning Academy · レッスン

学習中の正解率を追跡する

予測をスコアに変換します

「学習中の正解率を追跡する」はCoddyKit上の無料Deep Learning Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはDeep Learning Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Deep Learning Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Loss Alone Lies a Little

A falling loss feels good, but it is abstract. To know if your model is truly useful you also want accuracy, the share of predictions it gets right. 🎯

From Logits to a Choice

Your model outputs raw scores per class. To pick a prediction you take the index of the largest score with argmax along the class dimension.

preds = pred.argmax(dim=1)

Compare to the Truth

Now compare each predicted class to the real label. The result is a boolean tensor where True marks every example the model got right.

correct = preds == y

Count the Wins

Booleans add up like ones and zeros, so summing the matches gives a count of correct predictions in this batch.

num_correct = correct.sum().item()

Turn Count Into a Rate

Divide correct predictions by the batch size and you get accuracy, a number from zero to one that is easy to read as a percentage.

acc = num_correct / y.size(0)

Accumulate Across Batches

Per-batch accuracy is noisy, so keep running totals of correct and seen examples. Their ratio gives a stable epoch accuracy.

total_correct += num_correct
total_seen += y.size(0)

Report Each Epoch

At the end of an epoch compute the overall rate and print it beside the loss. Now you see both how confident and how correct the model is.

epoch_acc = total_correct / total_seen

Keep Metrics off the Graph

When you only measure, wrap scoring in no_grad. It stops PyTorch from tracking operations you never plan to backpropagate, saving memory.

with torch.no_grad():
    preds = model(x).argmax(dim=1)

Accuracy Is Not Enough Alone

On imbalanced data accuracy can fool you: always guessing the common class scores high yet learns nothing. Pair it with loss and other metrics.

Watch the Trend

One epoch's number means little; the trend is everything. Rising accuracy with falling loss is the clear sign your training is on track.

A Window Into Learning

Tracking accuracy turns training from a black box into something you can watch. Each epoch you get honest feedback on real progress.

Quick Check

How do you turn class scores into a single predicted label?

Recap

You learned to track accuracy: argmax the scores, compare to labels, count correct, and divide. Watch the trend alongside loss. 🎉

よくある質問

「学習中の正解率を追跡する」レッスンは無料ですか?

はい。「学習中の正解率を追跡する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Deep Learning Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Deep Learning Academyコースには全4レッスンが含まれています。

「学習中の正解率を追跡する」で何を学びますか?

予測をスコアに変換します ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Deep Learning Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのDeep Learning Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。

「学習中の正解率を追跡する」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このDeep Learning Academyレッスンでコードを書いて実行できますか?

はい。すべてのDeep Learning Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. 順伝播、損失、逆伝播、更新
  2. 最小限のトレーニングループを書く
  3. 学習中の正解率を追跡する
  4. 学習モードと評価モード
← Deep Learning Academyに戻る