• This function is used to step over the entire dataset by batchSize up until the entire dataset has been gone though. This returns a helper function that itself returns an iterator that is to be used each epoch during training.

    Parameters

    • batchSize: number

      How much to grab from the dataset each step.

    Returns (() => Generator<readonly [number, number, Tensor<Rank>], void, unknown>)

    a function that returns a new iterator.

      • (): Generator<readonly [number, number, Tensor<Rank>], void, unknown>
      • Returns Generator<readonly [number, number, Tensor<Rank>], void, unknown>

    Note

    Each element yield'ed by the iterator is a constant array [number, tensor].

    Note

    The tensor's needn't be disposed manually. Each previous tensor will be disposed before the following yield.

    Example

    const getIterator = datasetReader(50);

    for(let epoch = 0; epoch < 1000; epoch++) {
    for(const [timeTook, batchCount, batch] of getIterator()) {
    // do something with the batch of data.
    }
    }

Generated using TypeDoc