interface.ts 4.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * Definition of single dimension in search space.
 */
interface SingleAxis {
    baseName: string;
    fullName: string;
    type: string;
    scale: 'log' | 'linear' | 'ordinal';
    domain: any;
    nested: boolean;
}

/**
 * Definition of combination of multiple dimensions.
 * The decision in multiple dimensions will be combined together.
 * Typically, it is a search space or a sub search space.
 */
interface MultipleAxes {
    baseName: string;
    fullName: string;
    axes: Map<string, SingleAxis>;
}

24
// draw accuracy graph data export interface
Lijiao's avatar
Lijiao committed
25
26
27
28
29
30
interface TableObj {
    key: number;
    sequenceId: number;
    id: string;
    duration: number;
    status: string;
Lijiao's avatar
Lijiao committed
31
    acc?: FinalType; // draw accuracy graph
32
33
    description: Parameters;
    color?: string;
34
35
    startTime?: number;
    endTime?: number;
36
    intermediates: (MetricDataRecord | undefined)[];
37
    parameters(axes: MultipleAxes): Map<SingleAxis, any>;
38
    metrics(axes: MultipleAxes): Map<SingleAxis, any>;
39
40
}

41
42
43
44
45
46
47
48
49
interface TableRecord {
    key: string;
    sequenceId: number;
    startTime: number;
    endTime?: number;
    id: string;
    duration: number;
    status: string;
    intermediateCount: number;
Lijiaoa's avatar
Lijiaoa committed
50
    accuracy?: number | any;
Lijiao's avatar
Lijiao committed
51
    latestAccuracy: number | undefined;
52
53
    formattedLatestAccuracy: string; // format (LATEST/FINAL),
    accDictionary: FinalType | undefined;
54
55
}

56
57
58
59
60
interface SearchSpace {
    _value: Array<number | string>;
    _type: string;
}

61
62
63
64
interface FinalType {
    default: string;
}

Lijiao's avatar
Lijiao committed
65
66
67
interface ErrorParameter {
    error?: string;
}
68

Lijiao's avatar
Lijiao committed
69
70
71
interface Parameters {
    parameters: ErrorParameter;
    logPath?: string;
Lijiao's avatar
Lijiao committed
72
    intermediate: number[];
73
    multiProgress?: number;
Lijiao's avatar
Lijiao committed
74
75
76
77
}

// trial accuracy
interface AccurPoint {
Lijiao's avatar
Lijiao committed
78
79
    acc: number;
    index: number;
Lijiao's avatar
Lijiao committed
80
81
}

82
83
84
interface DetailAccurPoint {
    acc: number;
    index: number;
85
    searchSpace: object;
86
87
}

88
89
90
91
92
93
interface TooltipForIntermediate {
    data: string;
    seriesName: string;
    dataIndex: number;
}

94
95
96
97
interface TooltipForAccuracy {
    data: Array<number | object>;
}

Lijiao's avatar
Lijiao committed
98
99
100
101
102
103
104
interface Dimobj {
    dim: number;
    name: string;
    max?: number;
    min?: number;
    type?: string;
    data?: string[];
105
106
107
108
    boundaryGap?: boolean;
    axisTick?: object;
    axisLabel?: object;
    axisLine?: object;
109
    nameTextStyle?: object;
Lijiao's avatar
Lijiao committed
110
    scale?: boolean;
Lijiao's avatar
Lijiao committed
111
112
113
114
115
116
117
}

interface ParaObj {
    data: number[][];
    parallelAxis: Array<Dimobj>;
}

Lijiao's avatar
Lijiao committed
118
119
120
121
122
123
124
interface Intermedia {
    name: string; // id
    type: string;
    data: Array<number | object>; // intermediate data
    hyperPara: object; // each trial hyperpara value
}

125
126
127
128
129
130
131
132
133
interface MetricDataRecord {
    timestamp: number;
    trialJobId: string;
    type: string;
    sequence: number;
    data: string;
}

interface TrialJobInfo {
J-shang's avatar
J-shang committed
134
    trialJobId: string;
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
    sequenceId: number;
    status: string;
    startTime?: number;
    endTime?: number;
    hyperParameters?: string[];
    logPath?: string;
    finalMetricData?: MetricDataRecord[];
    stderrPath?: string;
}

interface ExperimentParams {
    authorName: string;
    experimentName: string;
    description?: string;
    trialConcurrency: number;
    maxExecDuration: number; // seconds
    maxTrialNum: number;
    searchSpace: string;
    trainingServicePlatform: string;
    multiThread?: boolean;
    versionCheck?: boolean;
    logCollection?: string;
    tuner?: {
        className: string;
        builtinTunerName?: string;
        codeDir?: string;
        classArgs?: any;
        classFileName?: string;
        checkpointDir: string;
        gpuNum?: number;
        includeIntermediateResults?: boolean;
    };
    assessor?: {
        className: string;
        builtinAssessorName?: string;
        codeDir?: string;
        classArgs?: any;
        classFileName?: string;
        checkpointDir: string;
        gpuNum?: number;
    };
    advisor?: {
        className: string;
        builtinAdvisorName?: string;
        codeDir?: string;
        classArgs?: any;
        classFileName?: string;
        checkpointDir: string;
        gpuNum?: number;
    };
    clusterMetaData?: {
        key: string;
187
        value: string | ClusterItem;
188
189
190
    }[];
}

191
192
193
194
interface ClusterItem {
    command?: string;
}

195
196
197
198
199
200
201
202
203
204
205
206
207
208
interface ExperimentProfile {
    params: ExperimentParams;
    id: string;
    execDuration: number;
    logDir?: string;
    startTime?: number;
    endTime?: number;
    maxSequenceId: number;
    revision: number;
}

interface NNIManagerStatus {
    status: string;
    errors: string[];
209
210
}

Lijiao's avatar
Lijiao committed
211
212
213
214
interface EventMap {
    [key: string]: () => void;
}

Lijiao's avatar
Lijiao committed
215
export {
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
    TableObj,
    TableRecord,
    SearchSpace,
    FinalType,
    ErrorParameter,
    Parameters,
    AccurPoint,
    DetailAccurPoint,
    TooltipForIntermediate,
    TooltipForAccuracy,
    Dimobj,
    ParaObj,
    Intermedia,
    MetricDataRecord,
    TrialJobInfo,
    ExperimentParams,
    ExperimentProfile,
    NNIManagerStatus,
    EventMap,
    SingleAxis,
    MultipleAxes
237
};