0Pricing
Deep Learning Academy · レッスン

SigmoidとTanh:値を範囲に押し込む

有界な出力と勾配消失という落とし穴を学びます

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

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

Squashing Activations

Some activations squeeze any input into a fixed range. The two classics are sigmoid and tanh, and both bend big numbers gently inward. 🤏

Sigmoid's Range

Sigmoid maps every value into the open interval from 0 to 1. That makes its output read naturally as a probability.

import torch
y = torch.sigmoid(x)   # outputs between 0 and 1

Its S-Shaped Curve

Sigmoid has a smooth S shape: near zero it changes fast, but far out it flattens. Large inputs all map to nearly the same value.

Tanh's Range

Tanh is sigmoid's cousin, but it squashes inputs into the range from minus 1 to plus 1, centered neatly on zero.

y = torch.tanh(x)   # outputs between -1 and 1

Why Centering Helps

Because tanh is zero-centered, its outputs balance around zero. That often gives smoother, faster learning than sigmoid for hidden layers.

The Flat Tails

Out at the edges, both curves go almost flat. A flat region means a tiny slope, and a tiny slope means a tiny gradient.

Vanishing Gradients

When gradients shrink toward zero, early layers barely update. This vanishing gradient trap stalls deep networks during training. 😴

Why ReLU Took Over

This vanishing problem is exactly why ReLU replaced sigmoid and tanh in most hidden layers. ReLU keeps a healthy gradient for positives.

Where Sigmoid Still Wins

Sigmoid stays useful at the output of a binary classifier, where you genuinely want a single probability between 0 and 1.

Where Tanh Still Wins

Tanh still appears inside recurrent cells like LSTMs, where its bounded, zero-centered output helps keep the hidden state stable.

Choosing Wisely

Rule of thumb: avoid sigmoid and tanh in deep hidden stacks, but keep sigmoid for a single probability output. Match the tool to the job.

Quick Check

Recall what happens at the flat tails of these curves.

Recap

Sigmoid squashes to 0 to 1 and tanh to minus 1 to 1. Their flat tails cause vanishing gradients, so save them for outputs and special cells. 🎯

よくある質問

「SigmoidとTanh:値を範囲に押し込む」レッスンは無料ですか?

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

「SigmoidとTanh:値を範囲に押し込む」で何を学びますか?

有界な出力と勾配消失という落とし穴を学びます ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

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

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

「SigmoidとTanh:値を範囲に押し込む」レッスンにはどのくらい時間がかかりますか?

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

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

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

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

  1. 非線形性が本当の力を引き出す理由
  2. ReLUとLeaky ReLU、GELUの仲間たち
  3. SigmoidとTanh:値を範囲に押し込む
  4. 確率のためのSoftmax
← Deep Learning Academyに戻る