watch: Guidance for input is required first to describe the object to be observed

Training is usually conducted to guide model training variables and to explain how a user ' s identity affects predictions.

Thematic shorts • IntroductionCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives 2 first fixes

Try to do it after reading

  • Clear distinction between automatic and visible surveillance
  • Validate a gradient object with input sensitivity

Suggested first

  • Python Basic Syntax:
  • Counting and training closed

Model parameters and input sensitivity are two requests

Training is usually conducted to guide model training variables and to explain how a user ' s identity affects predictions. Normal Tensor does not automatically become a source of recorder observations because it is passed into a model. The pre-calculation explicit call tape. watch(x) to allow the corresponding operation path to enter the subsequent input gradient query.

Set the input x = [2,3], model y = 4 x 1 - x 2. Use the input as a float position and monitor it first, then calculate the scale y = 5, and the gradient should read [4,−1]. This is not a model prediction of two samples, but two input directions for the same sample. If the shape is changed from [2] to [2,1], the characteristics axis may have been transformed into a batch axis and the same values cannot be interpreted as originally.

Automatic monitoring of training variables is a convenient default value and does not mean that all variables must be involved in updating. The recorder can see variables, and the optimizer can still receive only a portion of them. In turn, when turning off automatic observation variables, the target variables need to be clearly monitored in advance; Reads an empty list of variables when the model has not created weights, which leads to the subsequent creation of weights that are not monitored.

Integer is not continuous

There is usually no continuous significance to the category numbering, the word table indexing. Converts integer numbers simply to floating points and does not allow the check-list operation to become a micronumber selection. More reasonable explanations are often given to continuous vectors following a survey and to the fact that vector disturbances and real category substitution are not the same problem.

When model input is standardized, the unit of input gradient changes. Sets the original characteristic u via x = (u−10)/2 entering the model, y = 4 x, then the gradient for x is 4 and for u is 2. The sensitivity must be demonstrated by indicating the coordinates of the system, and the standardized lead cannot be referred to directly as the influence of the original business unit.

This section corresponds to TensorFlow2 GradientTape. Numerical examples are the synthesizing calculations of the input. Input gradients can only describe local changes in given models and cannot be interpreted directly causal effect I can't replace it. counterfactual Identification of the assumptions required.

Value recovery

u=12
x=(u-10)/2
assert 4*x == 4
assert 4/2 == 2
Are parameters automatically monitored and always updated by the optimist?

Not necessarily. Whether to obtain a gradient is a different step from whether to hand the variable over to the optimist, and the freezing strategy is to check both sides simultaneously.

The standard deviation has been changed from 2 to 4, and the other conditions are the same. How does the original u guide vary?

From chain rule to 4/4 = 1. The model does not change the coefficient of the standardized coordinates, and the number of guides for the original units is halved.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. TensorFlow — Introduction to gradients and automatic differentiation
  2. TensorFlow — GradientTape API

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.