interface.ts 4.99 KB
Newer Older
1
2
3
4
5
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { ExperimentConfig } from './experimentConfig';

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
 * 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>;
}

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

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

62
63
64
65
66
interface SearchSpace {
    _value: Array<number | string>;
    _type: string;
}

67
68
69
70
interface FinalType {
    default: string;
}

Lijiao's avatar
Lijiao committed
71
72
73
interface ErrorParameter {
    error?: string;
}
74

Lijiao's avatar
Lijiao committed
75
76
77
interface Parameters {
    parameters: ErrorParameter;
    logPath?: string;
Lijiao's avatar
Lijiao committed
78
    intermediate: number[];
79
    multiProgress?: number;
Lijiao's avatar
Lijiao committed
80
81
82
83
}

// trial accuracy
interface AccurPoint {
Lijiao's avatar
Lijiao committed
84
85
    acc: number;
    index: number;
Lijiao's avatar
Lijiao committed
86
87
}

88
89
90
interface DetailAccurPoint {
    acc: number;
    index: number;
91
    searchSpace: object;
92
93
}

94
95
96
97
98
99
interface TooltipForIntermediate {
    data: string;
    seriesName: string;
    dataIndex: number;
}

100
101
102
103
interface TooltipForAccuracy {
    data: Array<number | object>;
}

Lijiao's avatar
Lijiao committed
104
105
106
107
108
109
110
interface Dimobj {
    dim: number;
    name: string;
    max?: number;
    min?: number;
    type?: string;
    data?: string[];
111
112
113
114
    boundaryGap?: boolean;
    axisTick?: object;
    axisLabel?: object;
    axisLine?: object;
115
    nameTextStyle?: object;
Lijiao's avatar
Lijiao committed
116
    scale?: boolean;
Lijiao's avatar
Lijiao committed
117
118
119
120
121
122
123
}

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

Lijiao's avatar
Lijiao committed
124
125
126
127
128
interface Intermedia {
    name: string; // id
    type: string;
    data: Array<number | object>; // intermediate data
    hyperPara: object; // each trial hyperpara value
129
    trialNum: number;
Lijiao's avatar
Lijiao committed
130
131
}

132
133
134
135
136
137
138
139
140
interface MetricDataRecord {
    timestamp: number;
    trialJobId: string;
    type: string;
    sequence: number;
    data: string;
}

interface TrialJobInfo {
J-shang's avatar
J-shang committed
141
    trialJobId: string;
142
143
    sequenceId: number;
    status: string;
144
    message: string;
145
146
147
148
149
150
151
152
    startTime?: number;
    endTime?: number;
    hyperParameters?: string[];
    logPath?: string;
    finalMetricData?: MetricDataRecord[];
}

interface ExperimentProfile {
153
    params: ExperimentConfig;
154
155
    id: string;
    execDuration: number;
156
157
    logDir: string;
    startTime: number;
158
159
160
161
162
    endTime?: number;
    maxSequenceId: number;
    revision: number;
}

Yuge Zhang's avatar
Yuge Zhang committed
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
interface ExperimentMetadata {
    id: string;
    port: number;
    startTime: number | string;
    endTime: number | string;
    status: string;
    platform: string;
    experimentName: string;
    tag: any[];
    pid: number;
    webuiUrl: any[];
    logDir: string;
    prefixUrl: string | null;
}

178
179
180
interface NNIManagerStatus {
    status: string;
    errors: string[];
181
182
}

Lijiao's avatar
Lijiao committed
183
184
185
186
interface EventMap {
    [key: string]: () => void;
}

187
188
189
190
191
192
// table column sort
interface SortInfo {
    field: string;
    isDescend?: boolean;
}

193
194
195
196
197
198
199
200
201
202
203
204
interface AllExperimentList {
    id: string;
    experimentName: string;
    port: number;
    status: string;
    platform: string;
    startTime: number;
    endTime: number;
    tag: string[];
    pid: number;
    webuiUrl: string[];
    logDir: string[];
205
    prefixUrl: string;
206
}
Lijiaoa's avatar
Lijiaoa committed
207
208
209
210
211
212
213
214
215
216

interface Tensorboard {
    id: string;
    status: string;
    trialJobIdList: string[];
    trialLogDirectoryList: string[];
    pid: number;
    port: string;
}

217
218
219
220
221
222
223
224
225
226
// for TableList search
interface SearchItems {
    name: string;
    operator: string;
    value1: string; // first input value
    value2: string; // second input value
    choice: string[]; // use select multiy value list
    isChoice: boolean; // for parameters: type = choice and status also as choice type
}

Lijiao's avatar
Lijiao committed
227
export {
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    TableObj,
    TableRecord,
    SearchSpace,
    FinalType,
    ErrorParameter,
    Parameters,
    AccurPoint,
    DetailAccurPoint,
    TooltipForIntermediate,
    TooltipForAccuracy,
    Dimobj,
    ParaObj,
    Intermedia,
    MetricDataRecord,
    TrialJobInfo,
    ExperimentProfile,
Yuge Zhang's avatar
Yuge Zhang committed
244
    ExperimentMetadata,
245
246
247
    NNIManagerStatus,
    EventMap,
    SingleAxis,
248
    MultipleAxes,
249
    SortInfo,
Lijiaoa's avatar
Lijiaoa committed
250
    AllExperimentList,
251
    Tensorboard,
252
    SearchItems
253
};