shuffle buffer : Difference between local random and total disruption

Dataset. shuffle uses a limited buffer to select an output of elements from the buffer, supplemented by subsequent input.

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

Try to do it after reading

  • Explain limited buffer sampling process
  • Check whether ordered data are still relevant over a long period

Suggested first

  • Python Basic Syntax:
  • Counting and training closed

A little buffer won't wash the files completely

Dataset. shuffle uses a limited buffer to select an output of elements from the buffer, supplemented by subsequent input. When buffers are smaller than the size of the data, the output has a local mix, but not all of the probability of full ranking. Its ability to disperse time or class concentrations depends on the original sequence and buffer coverage.

Enter [1,2,3,4,5] the buffer size 2, which can be selected only between 1 and 2 for the first time, so that the first output cannot be 5. If the probability of making the first position, etc., comes from all five, the initial candidate must be allowed to cover all the data. This simple boundary description: The presence of random functions does not mean that the assumption of "full randomly arranged" is satisfied.

When documents are sorted by labels, the first 10,000 are zero and the second 10,000 are ten thousand, the buffer 100 may still allow a long period of training to focus on the single category. The re-entry statistics, the early gradient and the schedule of learning rates are all affected in sequence. Adding buffers, randomizing file sequences and staggering across documents are measures at different levels and should be selected in conjunction with data sources.

Random disruption is no substitute for a data cut

The training set can be disrupted and the attribution of members to the validation and testing set cannot be determined implicitly by shuffle. If multiple records of the same user are dispersed and then cut by bar, they may still result in leaks by the user. Time forecasting missions should also not mix future samples with historical training for random purposes. Randomity and independence are two conditions.

Recovering experiments are to document random seeds, whether they are being redisrupted, data lists and fragmentation strategies. The same seeds do not correspond to the same batch in different data sequences; Changes in new documents or filtering rules also change results. The mere writing of a seed in the log is not sufficient to prove that the same sequence was seen in two experiments.

buffer memory is estimated by the element of the location. If shuffle occurs after decoding and type conversion, each element may be much larger than the original file. A light-weight log mark can be broken and the more heavy content read, but the randomly read I/ O costs will also be included in the measurements.

This section corresponds to TensorFlow 2 tf. data. The first cannot be judged for 5 from buffer algorithms and does not rely on random output from the current machine. For sequence-sensitive tasks, diagnostics such as batch label ratios should be retained, rather than merely confirming the existence of shuffle.

First candidate for limited bufferEnter five numbers. The buffer can only accommodate the first two. The first candidate is only one and two12345Candidates: 1, 2First OutputThree, four, five, not yet in the buffer
The buffer size of 2 does not amount to an even and even order of the five data.
At 2 p.m., can the first output be four?

No, you can't. Only 1 and 2 were initially in the candidate buffer, and the values that follow have not yet been entered.

Expanding the shuffle buffer will fix the same user cross-training test set?

Can't. It changes the order and does not change the attribution of membership; User grouping should be used in a phased manner or agreed at an appropriate time.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. TensorFlow — tf.data: Build TensorFlow input pipelines
  2. TensorFlow — Dataset.shuffle

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.