Previous question · 1292
L1 and L2 norms
easyML Coding
Next question · 1294
Quarterly USD Sales Total
hardDatabase
Random coding question

1293. Gradient clipping

easy
GeneralGeneral
senior
Function contract
Inputs
grads
list
max_norm
float
Returns
value
list

Examples

Input
{
  "grads": [
    [
      3,
      4
    ],
    [
      0,
      12
    ]
  ],
  "max_norm": 10
}
Output
[
  [
    2.307692307692308,
    3.076923076923077
  ],
  [
    0,
    9.230769230769232
  ]
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
senior
entry
Tags
gradient-clipping
L2-norm
numpy
optimization

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
31 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