HyperAIHyperAI

Command Palette

Search for a command to run...

Softmax Function

Date

The softmax function (normalized exponential function, Softmax for short) is a function that converts an arbitrary real-valued vector (logits) into a probability distribution. The name “softmax” was introduced and popularized by John S. Bridle of the Royal Signals and Radar Establishment in the UK in 1989 in the context of neural networks; the related paper is “Training Stochastic Model Recognition Algorithms as Networks can Lead to Maximum Mutual Information Estimation of Parameters”, accepted by the Conference on Neural Information Processing Systems (NeurIPS 1989). Its computation is to exponentiate each component and then divide by the sum of the exponentials of all components, making all outputs positive and their sum equal to 1; therefore it is both a smooth approximation of argmax and a generalization of the sigmoid function in binary classification to the multiclass case. In neural networks, it is usually used as the output activation function of the classification layer and works with cross-entropy loss to interpret the network output as the probability of each class; in Transformers, it is used to normalize attention scores into weights. The function can introduce a temperature coefficient to adjust the steepness of the distribution; in practical implementations, the maximum input value is usually subtracted first to avoid exponential overflow.

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing

HyperAI Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp