interface.ts 4.94 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
    formattedLatestAccuracy: string; // format (LATEST/FINAL),
59
60
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Yuge Zhang's avatar
Yuge Zhang committed
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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;
}

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

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

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

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

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

216
217
218
219
220
221
222
223
224
225
// 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
226
export {
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
    TableObj,
    TableRecord,
    SearchSpace,
    FinalType,
    ErrorParameter,
    Parameters,
    AccurPoint,
    DetailAccurPoint,
    TooltipForIntermediate,
    TooltipForAccuracy,
    Dimobj,
    ParaObj,
    Intermedia,
    MetricDataRecord,
    TrialJobInfo,
    ExperimentProfile,
Yuge Zhang's avatar
Yuge Zhang committed
243
    ExperimentMetadata,
244
245
246
    NNIManagerStatus,
    EventMap,
    SingleAxis,
247
    MultipleAxes,
248
    SortInfo,
Lijiaoa's avatar
Lijiaoa committed
249
    AllExperimentList,
250
    Tensorboard,
251
    SearchItems
252
};