You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

summary.proto 4.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. syntax = "proto2";
  17. package mindspore.irpb;
  18. option cc_enable_arenas = true;
  19. // The ANF IR define, include the tensor and graph define
  20. import "anf_ir.proto";
  21. // Event Protocol buffer, Top define
  22. message Event {
  23. // Timestamp
  24. required double wall_time = 1;
  25. // The step of train.
  26. optional int64 step = 2;
  27. oneof what {
  28. // An event file was started, with the specified version.
  29. // Now version is "MindSpore.Event:1"
  30. string version = 3;
  31. // GraphDef.
  32. GraphProto graph_def = 4;
  33. // Summary data
  34. Summary summary = 5;
  35. Explain explain = 6;
  36. }
  37. }
  38. // A Summary is a set of named values that be produced regularly during training
  39. message Summary {
  40. message Image {
  41. // Dimensions of the image.
  42. required int32 height = 1;
  43. required int32 width = 2;
  44. // Valid colorspace values are:
  45. // 1 - grayscale type
  46. // 2 - grayscale + alpha type
  47. // 3 - RGB type
  48. // 4 - RGBA type
  49. // 5 - DIGITAL_YUV type
  50. // 6 - BGRA type
  51. required int32 colorspace = 3;
  52. // Image data in encoded format. Now only support the RGB.
  53. required bytes encoded_image = 4;
  54. }
  55. message Histogram {
  56. message bucket{
  57. // Count number of values fallen in [left, left + width).
  58. // For the right most bucket, range is [left, left + width].
  59. required double left = 1;
  60. required double width = 2;
  61. required int64 count = 3;
  62. }
  63. repeated bucket buckets = 1;
  64. optional int64 nan_count = 2;
  65. optional int64 pos_inf_count = 3;
  66. optional int64 neg_inf_count = 4;
  67. // max, min, sum will not take nan and inf into account.
  68. // If there is no valid value in tensor, max will be nan, min will be nan, sum will be 0.
  69. optional double max = 5;
  70. optional double min = 6;
  71. optional double sum = 7;
  72. // total number of values, including nan and inf
  73. optional int64 count = 8;
  74. }
  75. message Value {
  76. // Tag name for the data.
  77. required string tag = 1;
  78. // Value associated with the tag.
  79. oneof value {
  80. float scalar_value = 3;
  81. Image image = 4;
  82. TensorProto tensor = 8;
  83. Histogram histogram = 9;
  84. }
  85. }
  86. // Set of values for the summary.
  87. repeated Value value = 1;
  88. }
  89. message Explain {
  90. message Inference{
  91. repeated float ground_truth_prob = 1;
  92. repeated int32 predicted_label = 2;
  93. repeated float predicted_prob = 3;
  94. repeated float ground_truth_prob_sd = 4;
  95. repeated float ground_truth_prob_itl95_low = 5;
  96. repeated float ground_truth_prob_itl95_hi = 6;
  97. repeated float predicted_prob_sd = 7;
  98. repeated float predicted_prob_itl95_low = 8;
  99. repeated float predicted_prob_itl95_hi = 9;
  100. }
  101. message Explanation{
  102. optional string explain_method = 1;
  103. optional int32 label = 2;
  104. optional string heatmap_path = 3;
  105. }
  106. message Benchmark{
  107. optional string benchmark_method = 1;
  108. optional string explain_method = 2;
  109. optional float total_score = 3;
  110. repeated float label_score = 4;
  111. }
  112. message Metadata{
  113. repeated string label = 1;
  114. repeated string explain_method = 2;
  115. repeated string benchmark_method = 3;
  116. }
  117. message HocLayer {
  118. optional float prob = 1;
  119. repeated int32 box = 2; // List of repeated x, y, w, h
  120. }
  121. message Hoc {
  122. optional int32 label = 1;
  123. optional string mask = 2;
  124. repeated HocLayer layer = 3;
  125. }
  126. optional int32 sample_id = 1;
  127. optional string image_path = 2; // The Metadata and image path must have one fill in
  128. repeated int32 ground_truth_label = 3;
  129. optional Inference inference = 4;
  130. repeated Explanation explanation = 5;
  131. repeated Benchmark benchmark = 6;
  132. optional Metadata metadata = 7;
  133. optional string status = 8; // enum value: run, end
  134. repeated Hoc hoc = 9; // hierarchical occlusion counterfactual
  135. }