• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright 2019-2021 Huawei Technologies Co., Ltd
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package mindspore.irpb;
20option cc_enable_arenas = true;
21
22// The ANF IR define, include the tensor and graph define
23import "anf_ir.proto";
24
25// Event Protocol buffer, Top define
26message Event {
27  // Timestamp
28  required double wall_time = 1;
29
30  // The step of train.
31  optional int64 step = 2;
32
33  oneof what {
34    // An event file was started, with the specified version.
35    // Now version is "MindSpore.Event:1"
36    string version = 3;
37
38    // GraphDef.
39    GraphProto graph_def = 4;
40
41    // Summary data
42    Summary summary = 5;
43
44    Explain explain = 6;
45  }
46}
47
48// A Summary is a set of named values that be produced regularly during training
49message Summary {
50    message Image {
51        // Dimensions of the image.
52        required int32 height = 1;
53        required int32 width = 2;
54        // Valid colorspace values are:
55        //   1 - grayscale type
56        //   2 - grayscale + alpha type
57        //   3 - RGB type
58        //   4 - RGBA type
59        //   5 - DIGITAL_YUV type
60        //   6 - BGRA type
61        required int32 colorspace = 3;
62        // Image data in encoded format. Now only support the RGB.
63        required bytes encoded_image = 4;
64    }
65
66    message Histogram {
67      message bucket{
68          // Count number of values fallen in [left, left + width).
69          // For the right most bucket, range is [left, left + width].
70          required double left = 1;
71          required double width = 2;
72          required int64 count = 3;
73      }
74
75      repeated bucket buckets = 1;
76      optional int64 nan_count = 2;
77      optional int64 pos_inf_count = 3;
78      optional int64 neg_inf_count = 4;
79
80      // max, min, sum will not take nan and inf into account.
81      // If there is no valid value in tensor, max will be nan, min will be nan, sum will be 0.
82      optional double max = 5;
83      optional double min = 6;
84      optional double sum = 7;
85
86      // total number of values, including nan and inf
87      optional int64 count = 8;
88    }
89
90    message Value {
91        // Tag name for the data.
92        required string tag = 1;
93
94        // Value associated with the tag.
95        oneof value {
96            float scalar_value = 3;
97            Image image = 4;
98            TensorProto tensor = 8;
99            Histogram histogram = 9;
100        }
101    }
102
103    // Set of values for the summary.
104    repeated Value value = 1;
105}
106
107message Explain {
108    message Inference{
109        repeated float ground_truth_prob = 1;
110        repeated int32 predicted_label = 2;
111        repeated float predicted_prob = 3;
112        repeated float ground_truth_prob_sd = 4;
113        repeated float ground_truth_prob_itl95_low = 5;
114        repeated float ground_truth_prob_itl95_hi = 6;
115        repeated float predicted_prob_sd = 7;
116        repeated float predicted_prob_itl95_low = 8;
117        repeated float predicted_prob_itl95_hi = 9;
118    }
119
120    message Explanation{
121        optional string explain_method = 1;
122        optional int32 label = 2;
123        optional string heatmap_path = 3;
124    }
125
126    message Benchmark{
127        optional string benchmark_method = 1;
128        optional string explain_method = 2;
129        optional float total_score = 3;
130        repeated float label_score = 4;
131    }
132
133    message Metadata{
134        repeated string label = 1;
135        repeated string explain_method = 2;
136        repeated string benchmark_method = 3;
137    }
138
139    message HocLayer {
140        optional float prob = 1;
141        repeated int32 box = 2;  // List of repeated x, y, w, h
142    }
143
144    message Hoc {
145        optional int32 label = 1;
146        optional string mask = 2;
147        repeated HocLayer layer = 3;
148    }
149
150    optional int32 sample_id = 1;
151    optional string image_path = 2;  // The Metadata and image path must have one fill in
152    repeated int32 ground_truth_label = 3;
153
154    optional Inference inference = 4;
155    repeated Explanation explanation = 5;
156    repeated Benchmark benchmark = 6;
157
158    optional Metadata metadata = 7;
159    optional string status = 8;  // enum value: run, end
160
161    repeated Hoc hoc = 9; // hierarchical occlusion counterfactual
162}