Values of gradients to be returned

If I am making a function that has two inputs, what values is `tape.gradients` expecting?

For example, if I input data in a batch size to the function `f(x,y)`, the `tape.gradient` expects both of the returned gradients to be of shape (batch size, 2), however I’m not sure what should be the contents of those Tensors. For a batch size of 3, I thought it would look something like the following:

df/dx (x_1, y_1) df/dy (x_1, y_1)
df/dx (x_2, y_2) df/dy (x_2, y_2)
df/dx (x_3, y_3) df/dy (x_3, y_3)


Where the above table is a Tensor, but i have no idea what other tensor it could want for the second variable. Does anyone have an idea of what it should be? Thanks

submitted by /u/soravoid
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *