The Second Derivative
Let f be the sum of x² · sin(x) over the elements of x. Return the second derivative of f with respect to each element: the derivative of its derivative. Autograd can differentiate its own result when it is asked to keep the graph of the first pass.
Example 1
x [1.0]
returns [3.0026803]
The second derivative of x² · sin(x) is 2 · sin(x) + 4x · cos(x) - x² · sin(x). At 1 that is 3.0027.
Constraints
- 1 to 8 elements
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- Windows and TargetsHard
- A Table of ZerosBeginner
- Add Them UpBeginner
- Biggest and WhereBeginner
- Column AveragesBeginner
- Count UpBeginner
- Dot ProductBeginner
- HalvesBeginner