gx
chenyc
2025-02-12 ea42ff3ebee1eeb3fb29423aa848a249441db81c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Use of this source code is governed by an MIT-style
 * license that can be found in the LICENSE file or at
 * https://opensource.org/licenses/MIT.
 * =============================================================================
 */
/// <amd-module name="@tensorflow/tfjs-layers/dist/engine/dataset_fakes" />
import * as tfc from '@tensorflow/tfjs-core';
import { Shape } from '../keras_format/common';
import { TensorOrArrayOrMap } from '../types';
import { Dataset, LazyIterator } from './dataset_stub';
import { FitDatasetElement } from './training_dataset';
export interface FakeDatasetArgs {
    /**
     * The shape(s) of the features of a single example.
     *
     * Use an object mapping name to shape, if more than one feature tensors
     * are required.
     */
    xShape: Shape | {
        [name: string]: Shape;
    };
    /**
     * The shape of the target(s) of a single exapmle.
     */
    yShape: Shape | {
        [name: string]: Shape;
    };
    /**
     * A function that generates preset sequence of X tensors.
     *
     * This function is invoked each time a new iterator is created.
     */
    xTensorsFunc?: () => tfc.Tensor[] | {
        [name: string]: tfc.Tensor[];
    };
    /**
     * A function that generates preset sequence of Y tensors.
     *
     * This function is invoked each time a new iterator is created.
     */
    yTensorsFunc?: () => tfc.Tensor[] | {
        [name: string]: tfc.Tensor[];
    };
    /**
     * The size of each batch generated by the iterator.
     */
    batchSize: number;
    /**
     * The number of batches an iterator generates before declaring done to be
     * true.
     */
    numBatches: number;
}
/**
 * A fake dataset with configurable feature and target shapes.
 *
 * The batch size and # of batches are also configurable.
 *
 * The iterator from the dataset always generate random-normal float32 values.
 */
export declare class FakeNumericDataset extends Dataset<FitDatasetElement> {
    readonly args: FakeDatasetArgs;
    constructor(args: FakeDatasetArgs);
    iterator(): Promise<LazyIterator<FitDatasetElement>>;
}
export declare class FakeNumericDatasetLegacyArrayForm extends Dataset<[TensorOrArrayOrMap, TensorOrArrayOrMap]> {
    readonly args: FakeDatasetArgs;
    ds: FakeNumericDataset;
    constructor(args: FakeDatasetArgs);
    iterator(): Promise<LazyIterator<[TensorOrArrayOrMap, TensorOrArrayOrMap]>>;
}