concept gradient in category R

appears as: gradient, gradient, A gradient, gradients, gradients
Deep Learning with R

This is an excerpt from Manning's book Deep Learning with R.

But such an approach would be horribly inefficient, because you’d need to compute two forward passes (which are expensive) for every individual coefficient (of which there are many, usually thousands and sometimes up to millions). A much better approach is to take advantage of the fact that all operations used in the network are differentiable, and compute the gradient of the loss with regard to the network’s coefficients. You can then move the coefficients in the opposite direction from the gradient, thus decreasing the loss.

If you already know what differentiable means and what a gradient is, you can skip to section 2.4.3. Otherwise, the following two sections will help you understand these concepts.

Listing 5.33. Obtaining the gradient of the loss with regard to the input
grads <- k_gradients(loss, model$input)[[1]] 1