Previous question · 1130
Top City by Rides
hardDatabase
Next question · 1132
Baseball Game
easyData Structures
Random coding question

1131. Stable softmax

easy
GeneralGeneral
senior
Function contract
Inputs
logits
np.ndarray
Returns
value
np.ndarray

Examples

Input
{
  "logits": [
    [
      1000,
      1000,
      999
    ],
    [
      -1000,
      0,
      1000
    ]
  ]
}
Output
[
  [
    0.4223187982515182,
    0.4223187982515182,
    0.15536240349696362
  ],
  [
    0,
    0,
    1
  ]
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
senior
entry
Tags
softmax
numerical-stability
numpy
attention

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
49 people are solving this problem
Loading editor for the selected language
Ln 1, Col 1
Program Output
DATAINTERVIEW
Interactive coding terminal
Python / NumPy environment ready.
Type a command below or run code from the editor.
run scriptExecute the current editor contents
submitGrade the current editor contents against all solution test cases
python ("print hello world")Run an isolated Python command
helpShow all available commands