JVP and VJP: why not be the same multiplying for forward disturbances and reverse gradients

Calculates the volume of a single orientation lead with an inverse vector, checking the rotation and shape with the internal constant equivalent.

• Step by stepCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives . 1 first fix

Try to do it after reading

  • Calculate a single orientation lead and a reverse vector
  • Reconciling the transition and shape with an internal constant equation

Suggested first

  • Vector and Matrix Operations

Do not save the entire table of numbers for a gradient

Jacobian of a vector function records the number of guides per output to each input. If the input contains millions of parameters, it can be very expensive to store in a visible way. Many actual tasks only require a multiplier of Jacobian with a vector. An output change arising from a forward-looking input orientation obtained from JVP; Looking backwards at the sensitivity of the output end metric target, VJP was obtained. The two use the same local lead, but have different input and output space.

Distinguishing with a rectangle map

Set up Jacobian with two rows (1,2,0) and (0,1.3) respectively. For input orientation (1,1,2), JVP first is 1 minus 2 equals negative 1 and 2 is negative 1 plus 6 equals five, so the output direction is (-1,5). It answers how the two output changes when it moves a small step along this input direction. A further upstream vector (2,-1) to the output end, which converts Jacobian to receive (three-dimensional) input sensitivity (2,3,-3). The first input here affects only the first output, the second input affects both, and the third input affects only the second. Multiply JVP with the upstream vector point and receive negative seven; A negative seven is also obtained by multiplying the input direction with the VJP point. This built-in equation is a useful check.

When do you choose

If the input direction is small and many outputs are to be observed, the forward vector volume may be more natural; Reverse vector volumes are more common if the output ends with a few metrics and input parameters are numerous. This comparison is based on the number of independent directions, not simply on one of them being always faster. The actual automatic fractions are also influenced by arithmetic support, memory, recalculation and graphic structure, and require measurement rather than just looking at dimensions.

Boundary and misunderstanding

The upstream vector is not another real label, but the number of leades that follow the metric function to the current output. If it is wrongly set in its entirety, it is equivalent to a gradient for the output and the post-summation, and it is not necessarily a loss to optimize. A tacit attempt to reconcile batch output may also result in a quiet shift in the weight between samples or tasks. JVP describes the first level of local response to the current point and does not use the lead for one direction as a global counterfactual effect. If the function contains discrete sampling, sorting or intercepting, you must distinguish between the microagents used and the actual operations. (a) A small integer matrix to verify algebras; Real networks should also use limited differential checks in smooth areas and separately record indescribable commitments to avoid mixing two layers of problems.

uT(Jv)=(JTu)Tv

Self-measurement and provocator

What are the dimensions of JVP and VJP, respectively?

JVP is two-dimensional and belongs to the output space; VJP is three-dimensional and belongs to the input space, and the two cannot be compared directly by element.

What do you get all the upstream vectors?

A gradient to get all the output; Only when the follow-up goal is indeed a peace-building one will be consistent with expectations.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Mathematics for Machine Learning — author textbook
  2. MIT 18.02SC Multivariable Calculus

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.