Backpropagates supplied root_gradients for one or more of the output variables of the Function, to calculate gradients with respect to variables. Formally, multiplies the values of root_gradients by the Jacobian of the Function and returns the subset of the output that corresponds to variables.

func_backward(func, state, root_gradients, variables, as_matrix = TRUE)

Arguments

func

- The CNTK `Function` instance on which to apply the operation

as_matrix

- whether to return as an R matrix. Defualt TRUE. Otherwise returns as Python CNTK value which avoids costly conversions