-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtypes.ts
55 lines (46 loc) · 1.26 KB
/
types.ts
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
import * as tf from '@tensorflow/tfjs';
export interface IClasses {
[index: string]: number;
}
// export enum DataType {
// TRAIN = "train",
// EVAL = "eval",
// };
export interface IData {
classes: IClasses;
[index: string]: IImageData;
}
export interface IImageData {
xs?: tf.Tensor;
ys?: tf.Tensor2D;
}
export interface ICollectedData {
classes: IClasses;
xs?: tf.Tensor;
ys?: tf.Tensor2D;
}
export interface IParams {
[index: string]: any;
batchSize?: number;
epochs?: number;
};
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
export interface IArgs {
pretrainedModel?: string | tf.Model;
trainingModel?: tf.Model | Function;
// trainingModel?: tf.Model | (data: IImageData, classes: number, params: IParams) => tf.Model;
onLoadStart?: Function;
onLoadComplete?: Function;
onAddDataStart?: Function;
onAddDataComplete?: Function;
onClearDataStart?: Function;
onClearDataComplete?: Function;
onTrainStart?: Function;
onTrainComplete?: Function;
onPredictComplete?: Function;
onPredictStart?: Function;
onEvaluateStart?: Function;
onEvaluateComplete?: Function;
onSaveStart?: Function;
onSaveComplete?: Function;
}