FunctionRacerProblemsRace

Two Parameters

MediumPyTorchPython

A curve predicts a * x² + b * x for every element of x, and its loss is the mean of the squared differences from y. Return the gradient of the loss with respect to a and to b, at the values given: [d loss / d a, d loss / d b].

Example 1

x [1.0,2.0]
y [0.0,0.0]
a 1.0
b 0.0
returns [17.0,9.0]

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More PyTorch problems