活性化関数Softsign更新日:2026-11-24概要Softsign関数は、シグモイド関数と同様に滑らかなS字型の関数であり、活性化関数です。 関数の形はTanh関数と似ていますが、導関数のピークが鋭い点が特徴です。 Softsign(x)=x1+∣x∣\text{Softsign}(x) = \frac{x}{1 + |x|}Softsign(x)=1+∣x∣xPyTorch の実装例▶コードを開くpythonコピー# PyTorch import torch import torch.nn as nn class NN(nn.Module): def __init__(self): super().__init__() def softsign(self, x): return x / (1 + torch.abs(x)) def forward(self, x): x = self.softsign(x) return x参考文献X. Glorot and Y. Bengio, "Understanding the difficulty of training deep feedforward neural networks," Proceedings of the 13th International Conference on Artificial Intelligence and Statistics (AISTATS), PMLR 9, 249–256, 2010.PyTorch Documentation, "torch.nn.Softsign."← 一覧に戻る