-
Notifications
You must be signed in to change notification settings - Fork 195
/
explanation.pb.go
2705 lines (2430 loc) · 117 KB
/
explanation.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.12.4
// source: mockgcp/cloud/aiplatform/v1beta1/explanation.proto
package aiplatformpb
import (
_struct "github.com/golang/protobuf/ptypes/struct"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The format of the input example instances.
type Examples_ExampleGcsSource_DataFormat int32
const (
// Format unspecified, used when unset.
Examples_ExampleGcsSource_DATA_FORMAT_UNSPECIFIED Examples_ExampleGcsSource_DataFormat = 0
// Examples are stored in JSONL files.
Examples_ExampleGcsSource_JSONL Examples_ExampleGcsSource_DataFormat = 1
)
// Enum value maps for Examples_ExampleGcsSource_DataFormat.
var (
Examples_ExampleGcsSource_DataFormat_name = map[int32]string{
0: "DATA_FORMAT_UNSPECIFIED",
1: "JSONL",
}
Examples_ExampleGcsSource_DataFormat_value = map[string]int32{
"DATA_FORMAT_UNSPECIFIED": 0,
"JSONL": 1,
}
)
func (x Examples_ExampleGcsSource_DataFormat) Enum() *Examples_ExampleGcsSource_DataFormat {
p := new(Examples_ExampleGcsSource_DataFormat)
*p = x
return p
}
func (x Examples_ExampleGcsSource_DataFormat) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Examples_ExampleGcsSource_DataFormat) Descriptor() protoreflect.EnumDescriptor {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[0].Descriptor()
}
func (Examples_ExampleGcsSource_DataFormat) Type() protoreflect.EnumType {
return &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[0]
}
func (x Examples_ExampleGcsSource_DataFormat) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Examples_ExampleGcsSource_DataFormat.Descriptor instead.
func (Examples_ExampleGcsSource_DataFormat) EnumDescriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{12, 0, 0}
}
// Preset option controlling parameters for query speed-precision trade-off
type Presets_Query int32
const (
// More precise neighbors as a trade-off against slower response.
Presets_PRECISE Presets_Query = 0
// Faster response as a trade-off against less precise neighbors.
Presets_FAST Presets_Query = 1
)
// Enum value maps for Presets_Query.
var (
Presets_Query_name = map[int32]string{
0: "PRECISE",
1: "FAST",
}
Presets_Query_value = map[string]int32{
"PRECISE": 0,
"FAST": 1,
}
)
func (x Presets_Query) Enum() *Presets_Query {
p := new(Presets_Query)
*p = x
return p
}
func (x Presets_Query) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Presets_Query) Descriptor() protoreflect.EnumDescriptor {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[1].Descriptor()
}
func (Presets_Query) Type() protoreflect.EnumType {
return &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[1]
}
func (x Presets_Query) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Presets_Query.Descriptor instead.
func (Presets_Query) EnumDescriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{13, 0}
}
// Preset option controlling parameters for different modalities
type Presets_Modality int32
const (
// Should not be set. Added as a recommended best practice for enums
Presets_MODALITY_UNSPECIFIED Presets_Modality = 0
// IMAGE modality
Presets_IMAGE Presets_Modality = 1
// TEXT modality
Presets_TEXT Presets_Modality = 2
// TABULAR modality
Presets_TABULAR Presets_Modality = 3
)
// Enum value maps for Presets_Modality.
var (
Presets_Modality_name = map[int32]string{
0: "MODALITY_UNSPECIFIED",
1: "IMAGE",
2: "TEXT",
3: "TABULAR",
}
Presets_Modality_value = map[string]int32{
"MODALITY_UNSPECIFIED": 0,
"IMAGE": 1,
"TEXT": 2,
"TABULAR": 3,
}
)
func (x Presets_Modality) Enum() *Presets_Modality {
p := new(Presets_Modality)
*p = x
return p
}
func (x Presets_Modality) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Presets_Modality) Descriptor() protoreflect.EnumDescriptor {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[2].Descriptor()
}
func (Presets_Modality) Type() protoreflect.EnumType {
return &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[2]
}
func (x Presets_Modality) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Presets_Modality.Descriptor instead.
func (Presets_Modality) EnumDescriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{13, 1}
}
// Data format enum.
type ExamplesOverride_DataFormat int32
const (
// Unspecified format. Must not be used.
ExamplesOverride_DATA_FORMAT_UNSPECIFIED ExamplesOverride_DataFormat = 0
// Provided data is a set of model inputs.
ExamplesOverride_INSTANCES ExamplesOverride_DataFormat = 1
// Provided data is a set of embeddings.
ExamplesOverride_EMBEDDINGS ExamplesOverride_DataFormat = 2
)
// Enum value maps for ExamplesOverride_DataFormat.
var (
ExamplesOverride_DataFormat_name = map[int32]string{
0: "DATA_FORMAT_UNSPECIFIED",
1: "INSTANCES",
2: "EMBEDDINGS",
}
ExamplesOverride_DataFormat_value = map[string]int32{
"DATA_FORMAT_UNSPECIFIED": 0,
"INSTANCES": 1,
"EMBEDDINGS": 2,
}
)
func (x ExamplesOverride_DataFormat) Enum() *ExamplesOverride_DataFormat {
p := new(ExamplesOverride_DataFormat)
*p = x
return p
}
func (x ExamplesOverride_DataFormat) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ExamplesOverride_DataFormat) Descriptor() protoreflect.EnumDescriptor {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[3].Descriptor()
}
func (ExamplesOverride_DataFormat) Type() protoreflect.EnumType {
return &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_enumTypes[3]
}
func (x ExamplesOverride_DataFormat) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ExamplesOverride_DataFormat.Descriptor instead.
func (ExamplesOverride_DataFormat) EnumDescriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{16, 0}
}
// Explanation of a prediction (provided in
// [PredictResponse.predictions][mockgcp.cloud.aiplatform.v1beta1.PredictResponse.predictions])
// produced by the Model on a given
// [instance][mockgcp.cloud.aiplatform.v1beta1.ExplainRequest.instances].
type Explanation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. Feature attributions grouped by predicted outputs.
//
// For Models that predict only one output, such as regression Models that
// predict only one score, there is only one attibution that explains the
// predicted output. For Models that predict multiple outputs, such as
// multiclass Models that predict multiple classes, each element explains one
// specific item.
// [Attribution.output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index]
// can be used to identify which output this attribution is explaining.
//
// By default, we provide Shapley values for the predicted class. However,
// you can configure the explanation request to generate Shapley values for
// any other classes too. For example, if a model predicts a probability of
// `0.4` for approving a loan application, the model's decision is to reject
// the application since `p(reject) = 0.6 > p(approve) = 0.4`, and the default
// Shapley values would be computed for rejection decision and not approval,
// even though the latter might be the positive class.
//
// If users set
// [ExplanationParameters.top_k][mockgcp.cloud.aiplatform.v1beta1.ExplanationParameters.top_k],
// the attributions are sorted by
// [instance_output_value][Attributions.instance_output_value] in descending
// order. If
// [ExplanationParameters.output_indices][mockgcp.cloud.aiplatform.v1beta1.ExplanationParameters.output_indices]
// is specified, the attributions are stored by
// [Attribution.output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index]
// in the same order as they appear in the output_indices.
Attributions []*Attribution `protobuf:"bytes,1,rep,name=attributions,proto3" json:"attributions,omitempty"`
// Output only. List of the nearest neighbors for example-based explanations.
//
// For models deployed with the examples explanations feature enabled, the
// attributions field is empty and instead the neighbors field is populated.
Neighbors []*Neighbor `protobuf:"bytes,2,rep,name=neighbors,proto3" json:"neighbors,omitempty"`
}
func (x *Explanation) Reset() {
*x = Explanation{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Explanation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Explanation) ProtoMessage() {}
func (x *Explanation) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Explanation.ProtoReflect.Descriptor instead.
func (*Explanation) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{0}
}
func (x *Explanation) GetAttributions() []*Attribution {
if x != nil {
return x.Attributions
}
return nil
}
func (x *Explanation) GetNeighbors() []*Neighbor {
if x != nil {
return x.Neighbors
}
return nil
}
// Aggregated explanation metrics for a Model over a set of instances.
type ModelExplanation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. Aggregated attributions explaining the Model's prediction
// outputs over the set of instances. The attributions are grouped by outputs.
//
// For Models that predict only one output, such as regression Models that
// predict only one score, there is only one attibution that explains the
// predicted output. For Models that predict multiple outputs, such as
// multiclass Models that predict multiple classes, each element explains one
// specific item.
// [Attribution.output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index]
// can be used to identify which output this attribution is explaining.
//
// The
// [baselineOutputValue][mockgcp.cloud.aiplatform.v1beta1.Attribution.baseline_output_value],
// [instanceOutputValue][mockgcp.cloud.aiplatform.v1beta1.Attribution.instance_output_value]
// and
// [featureAttributions][mockgcp.cloud.aiplatform.v1beta1.Attribution.feature_attributions]
// fields are averaged over the test data.
//
// NOTE: Currently AutoML tabular classification Models produce only one
// attribution, which averages attributions over all the classes it predicts.
// [Attribution.approximation_error][mockgcp.cloud.aiplatform.v1beta1.Attribution.approximation_error]
// is not populated.
MeanAttributions []*Attribution `protobuf:"bytes,1,rep,name=mean_attributions,json=meanAttributions,proto3" json:"mean_attributions,omitempty"`
}
func (x *ModelExplanation) Reset() {
*x = ModelExplanation{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ModelExplanation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ModelExplanation) ProtoMessage() {}
func (x *ModelExplanation) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ModelExplanation.ProtoReflect.Descriptor instead.
func (*ModelExplanation) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{1}
}
func (x *ModelExplanation) GetMeanAttributions() []*Attribution {
if x != nil {
return x.MeanAttributions
}
return nil
}
// Attribution that explains a particular prediction output.
type Attribution struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. Model predicted output if the input instance is constructed
// from the baselines of all the features defined in
// [ExplanationMetadata.inputs][mockgcp.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs].
// The field name of the output is determined by the key in
// [ExplanationMetadata.outputs][mockgcp.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs].
//
// If the Model's predicted output has multiple dimensions (rank > 1), this is
// the value in the output located by
// [output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index].
//
// If there are multiple baselines, their output values are averaged.
BaselineOutputValue float64 `protobuf:"fixed64,1,opt,name=baseline_output_value,json=baselineOutputValue,proto3" json:"baseline_output_value,omitempty"`
// Output only. Model predicted output on the corresponding [explanation
// instance][ExplainRequest.instances]. The field name of the output is
// determined by the key in
// [ExplanationMetadata.outputs][mockgcp.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs].
//
// If the Model predicted output has multiple dimensions, this is the value in
// the output located by
// [output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index].
InstanceOutputValue float64 `protobuf:"fixed64,2,opt,name=instance_output_value,json=instanceOutputValue,proto3" json:"instance_output_value,omitempty"`
// Output only. Attributions of each explained feature. Features are extracted
// from the [prediction
// instances][mockgcp.cloud.aiplatform.v1beta1.ExplainRequest.instances]
// according to [explanation metadata for
// inputs][mockgcp.cloud.aiplatform.v1beta1.ExplanationMetadata.inputs].
//
// The value is a struct, whose keys are the name of the feature. The values
// are how much the feature in the
// [instance][mockgcp.cloud.aiplatform.v1beta1.ExplainRequest.instances]
// contributed to the predicted result.
//
// The format of the value is determined by the feature's input format:
//
// - If the feature is a scalar value, the attribution value is a
// [floating number][google.protobuf.Value.number_value].
//
// - If the feature is an array of scalar values, the attribution value is
// an [array][google.protobuf.Value.list_value].
//
// - If the feature is a struct, the attribution value is a
// [struct][google.protobuf.Value.struct_value]. The keys in the
// attribution value struct are the same as the keys in the feature
// struct. The formats of the values in the attribution struct are
// determined by the formats of the values in the feature struct.
//
// The
// [ExplanationMetadata.feature_attributions_schema_uri][mockgcp.cloud.aiplatform.v1beta1.ExplanationMetadata.feature_attributions_schema_uri]
// field, pointed to by the
// [ExplanationSpec][mockgcp.cloud.aiplatform.v1beta1.ExplanationSpec] field of
// the
// [Endpoint.deployed_models][mockgcp.cloud.aiplatform.v1beta1.Endpoint.deployed_models]
// object, points to the schema file that describes the features and their
// attribution values (if it is populated).
FeatureAttributions *_struct.Value `protobuf:"bytes,3,opt,name=feature_attributions,json=featureAttributions,proto3" json:"feature_attributions,omitempty"`
// Output only. The index that locates the explained prediction output.
//
// If the prediction output is a scalar value, output_index is not populated.
// If the prediction output has multiple dimensions, the length of the
// output_index list is the same as the number of dimensions of the output.
// The i-th element in output_index is the element index of the i-th dimension
// of the output vector. Indices start from 0.
OutputIndex []int32 `protobuf:"varint,4,rep,packed,name=output_index,json=outputIndex,proto3" json:"output_index,omitempty"`
// Output only. The display name of the output identified by
// [output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index].
// For example, the predicted class name by a multi-classification Model.
//
// This field is only populated iff the Model predicts display names as a
// separate field along with the explained output. The predicted display name
// must has the same shape of the explained output, and can be located using
// output_index.
OutputDisplayName string `protobuf:"bytes,5,opt,name=output_display_name,json=outputDisplayName,proto3" json:"output_display_name,omitempty"`
// Output only. Error of
// [feature_attributions][mockgcp.cloud.aiplatform.v1beta1.Attribution.feature_attributions]
// caused by approximation used in the explanation method. Lower value means
// more precise attributions.
//
// * For Sampled Shapley
// [attribution][mockgcp.cloud.aiplatform.v1beta1.ExplanationParameters.sampled_shapley_attribution],
// increasing
// [path_count][mockgcp.cloud.aiplatform.v1beta1.SampledShapleyAttribution.path_count]
// might reduce the error.
// * For Integrated Gradients
// [attribution][mockgcp.cloud.aiplatform.v1beta1.ExplanationParameters.integrated_gradients_attribution],
// increasing
// [step_count][mockgcp.cloud.aiplatform.v1beta1.IntegratedGradientsAttribution.step_count]
// might reduce the error.
// * For [XRAI
// attribution][mockgcp.cloud.aiplatform.v1beta1.ExplanationParameters.xrai_attribution],
// increasing
// [step_count][mockgcp.cloud.aiplatform.v1beta1.XraiAttribution.step_count]
// might reduce the error.
//
// See [this introduction](/vertex-ai/docs/explainable-ai/overview)
// for more information.
ApproximationError float64 `protobuf:"fixed64,6,opt,name=approximation_error,json=approximationError,proto3" json:"approximation_error,omitempty"`
// Output only. Name of the explain output. Specified as the key in
// [ExplanationMetadata.outputs][mockgcp.cloud.aiplatform.v1beta1.ExplanationMetadata.outputs].
OutputName string `protobuf:"bytes,7,opt,name=output_name,json=outputName,proto3" json:"output_name,omitempty"`
}
func (x *Attribution) Reset() {
*x = Attribution{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Attribution) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Attribution) ProtoMessage() {}
func (x *Attribution) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Attribution.ProtoReflect.Descriptor instead.
func (*Attribution) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{2}
}
func (x *Attribution) GetBaselineOutputValue() float64 {
if x != nil {
return x.BaselineOutputValue
}
return 0
}
func (x *Attribution) GetInstanceOutputValue() float64 {
if x != nil {
return x.InstanceOutputValue
}
return 0
}
func (x *Attribution) GetFeatureAttributions() *_struct.Value {
if x != nil {
return x.FeatureAttributions
}
return nil
}
func (x *Attribution) GetOutputIndex() []int32 {
if x != nil {
return x.OutputIndex
}
return nil
}
func (x *Attribution) GetOutputDisplayName() string {
if x != nil {
return x.OutputDisplayName
}
return ""
}
func (x *Attribution) GetApproximationError() float64 {
if x != nil {
return x.ApproximationError
}
return 0
}
func (x *Attribution) GetOutputName() string {
if x != nil {
return x.OutputName
}
return ""
}
// Neighbors for example-based explanations.
type Neighbor struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Output only. The neighbor id.
NeighborId string `protobuf:"bytes,1,opt,name=neighbor_id,json=neighborId,proto3" json:"neighbor_id,omitempty"`
// Output only. The neighbor distance.
NeighborDistance float64 `protobuf:"fixed64,2,opt,name=neighbor_distance,json=neighborDistance,proto3" json:"neighbor_distance,omitempty"`
}
func (x *Neighbor) Reset() {
*x = Neighbor{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Neighbor) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Neighbor) ProtoMessage() {}
func (x *Neighbor) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Neighbor.ProtoReflect.Descriptor instead.
func (*Neighbor) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{3}
}
func (x *Neighbor) GetNeighborId() string {
if x != nil {
return x.NeighborId
}
return ""
}
func (x *Neighbor) GetNeighborDistance() float64 {
if x != nil {
return x.NeighborDistance
}
return 0
}
// Specification of Model explanation.
type ExplanationSpec struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. Parameters that configure explaining of the Model's predictions.
Parameters *ExplanationParameters `protobuf:"bytes,1,opt,name=parameters,proto3" json:"parameters,omitempty"`
// Optional. Metadata describing the Model's input and output for explanation.
Metadata *ExplanationMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
}
func (x *ExplanationSpec) Reset() {
*x = ExplanationSpec{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExplanationSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExplanationSpec) ProtoMessage() {}
func (x *ExplanationSpec) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExplanationSpec.ProtoReflect.Descriptor instead.
func (*ExplanationSpec) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{4}
}
func (x *ExplanationSpec) GetParameters() *ExplanationParameters {
if x != nil {
return x.Parameters
}
return nil
}
func (x *ExplanationSpec) GetMetadata() *ExplanationMetadata {
if x != nil {
return x.Metadata
}
return nil
}
// Parameters to configure explaining for Model's predictions.
type ExplanationParameters struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Method:
//
// *ExplanationParameters_SampledShapleyAttribution
// *ExplanationParameters_IntegratedGradientsAttribution
// *ExplanationParameters_XraiAttribution
// *ExplanationParameters_Examples
Method isExplanationParameters_Method `protobuf_oneof:"method"`
// If populated, returns attributions for top K indices of outputs
// (defaults to 1). Only applies to Models that predicts more than one outputs
// (e,g, multi-class Models). When set to -1, returns explanations for all
// outputs.
TopK int32 `protobuf:"varint,4,opt,name=top_k,json=topK,proto3" json:"top_k,omitempty"`
// If populated, only returns attributions that have
// [output_index][mockgcp.cloud.aiplatform.v1beta1.Attribution.output_index]
// contained in output_indices. It must be an ndarray of integers, with the
// same shape of the output it's explaining.
//
// If not populated, returns attributions for
// [top_k][mockgcp.cloud.aiplatform.v1beta1.ExplanationParameters.top_k]
// indices of outputs. If neither top_k nor output_indices is populated,
// returns the argmax index of the outputs.
//
// Only applicable to Models that predict multiple outputs (e,g, multi-class
// Models that predict multiple classes).
OutputIndices *_struct.ListValue `protobuf:"bytes,5,opt,name=output_indices,json=outputIndices,proto3" json:"output_indices,omitempty"`
}
func (x *ExplanationParameters) Reset() {
*x = ExplanationParameters{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExplanationParameters) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExplanationParameters) ProtoMessage() {}
func (x *ExplanationParameters) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExplanationParameters.ProtoReflect.Descriptor instead.
func (*ExplanationParameters) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{5}
}
func (m *ExplanationParameters) GetMethod() isExplanationParameters_Method {
if m != nil {
return m.Method
}
return nil
}
func (x *ExplanationParameters) GetSampledShapleyAttribution() *SampledShapleyAttribution {
if x, ok := x.GetMethod().(*ExplanationParameters_SampledShapleyAttribution); ok {
return x.SampledShapleyAttribution
}
return nil
}
func (x *ExplanationParameters) GetIntegratedGradientsAttribution() *IntegratedGradientsAttribution {
if x, ok := x.GetMethod().(*ExplanationParameters_IntegratedGradientsAttribution); ok {
return x.IntegratedGradientsAttribution
}
return nil
}
func (x *ExplanationParameters) GetXraiAttribution() *XraiAttribution {
if x, ok := x.GetMethod().(*ExplanationParameters_XraiAttribution); ok {
return x.XraiAttribution
}
return nil
}
func (x *ExplanationParameters) GetExamples() *Examples {
if x, ok := x.GetMethod().(*ExplanationParameters_Examples); ok {
return x.Examples
}
return nil
}
func (x *ExplanationParameters) GetTopK() int32 {
if x != nil {
return x.TopK
}
return 0
}
func (x *ExplanationParameters) GetOutputIndices() *_struct.ListValue {
if x != nil {
return x.OutputIndices
}
return nil
}
type isExplanationParameters_Method interface {
isExplanationParameters_Method()
}
type ExplanationParameters_SampledShapleyAttribution struct {
// An attribution method that approximates Shapley values for features that
// contribute to the label being predicted. A sampling strategy is used to
// approximate the value rather than considering all subsets of features.
// Refer to this paper for model details: https://arxiv.org/abs/1306.4265.
SampledShapleyAttribution *SampledShapleyAttribution `protobuf:"bytes,1,opt,name=sampled_shapley_attribution,json=sampledShapleyAttribution,proto3,oneof"`
}
type ExplanationParameters_IntegratedGradientsAttribution struct {
// An attribution method that computes Aumann-Shapley values taking
// advantage of the model's fully differentiable structure. Refer to this
// paper for more details: https://arxiv.org/abs/1703.01365
IntegratedGradientsAttribution *IntegratedGradientsAttribution `protobuf:"bytes,2,opt,name=integrated_gradients_attribution,json=integratedGradientsAttribution,proto3,oneof"`
}
type ExplanationParameters_XraiAttribution struct {
// An attribution method that redistributes Integrated Gradients
// attribution to segmented regions, taking advantage of the model's fully
// differentiable structure. Refer to this paper for
// more details: https://arxiv.org/abs/1906.02825
//
// XRAI currently performs better on natural images, like a picture of a
// house or an animal. If the images are taken in artificial environments,
// like a lab or manufacturing line, or from diagnostic equipment, like
// x-rays or quality-control cameras, use Integrated Gradients instead.
XraiAttribution *XraiAttribution `protobuf:"bytes,3,opt,name=xrai_attribution,json=xraiAttribution,proto3,oneof"`
}
type ExplanationParameters_Examples struct {
// Example-based explanations that returns the nearest neighbors from the
// provided dataset.
Examples *Examples `protobuf:"bytes,7,opt,name=examples,proto3,oneof"`
}
func (*ExplanationParameters_SampledShapleyAttribution) isExplanationParameters_Method() {}
func (*ExplanationParameters_IntegratedGradientsAttribution) isExplanationParameters_Method() {}
func (*ExplanationParameters_XraiAttribution) isExplanationParameters_Method() {}
func (*ExplanationParameters_Examples) isExplanationParameters_Method() {}
// An attribution method that approximates Shapley values for features that
// contribute to the label being predicted. A sampling strategy is used to
// approximate the value rather than considering all subsets of features.
type SampledShapleyAttribution struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The number of feature permutations to consider when approximating
// the Shapley values.
//
// Valid range of its value is [1, 50], inclusively.
PathCount int32 `protobuf:"varint,1,opt,name=path_count,json=pathCount,proto3" json:"path_count,omitempty"`
}
func (x *SampledShapleyAttribution) Reset() {
*x = SampledShapleyAttribution{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SampledShapleyAttribution) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SampledShapleyAttribution) ProtoMessage() {}
func (x *SampledShapleyAttribution) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SampledShapleyAttribution.ProtoReflect.Descriptor instead.
func (*SampledShapleyAttribution) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{6}
}
func (x *SampledShapleyAttribution) GetPathCount() int32 {
if x != nil {
return x.PathCount
}
return 0
}
// An attribution method that computes the Aumann-Shapley value taking advantage
// of the model's fully differentiable structure. Refer to this paper for
// more details: https://arxiv.org/abs/1703.01365
type IntegratedGradientsAttribution struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Required. The number of steps for approximating the path integral.
// A good value to start is 50 and gradually increase until the
// sum to diff property is within the desired error range.
//
// Valid range of its value is [1, 100], inclusively.
StepCount int32 `protobuf:"varint,1,opt,name=step_count,json=stepCount,proto3" json:"step_count,omitempty"`
// Config for SmoothGrad approximation of gradients.
//
// When enabled, the gradients are approximated by averaging the gradients
// from noisy samples in the vicinity of the inputs. Adding
// noise can help improve the computed gradients. Refer to this paper for more
// details: https://arxiv.org/pdf/1706.03825.pdf
SmoothGradConfig *SmoothGradConfig `protobuf:"bytes,2,opt,name=smooth_grad_config,json=smoothGradConfig,proto3" json:"smooth_grad_config,omitempty"`
// Config for IG with blur baseline.
//
// When enabled, a linear path from the maximally blurred image to the input
// image is created. Using a blurred baseline instead of zero (black image) is
// motivated by the BlurIG approach explained here:
// https://arxiv.org/abs/2004.03383
BlurBaselineConfig *BlurBaselineConfig `protobuf:"bytes,3,opt,name=blur_baseline_config,json=blurBaselineConfig,proto3" json:"blur_baseline_config,omitempty"`
}
func (x *IntegratedGradientsAttribution) Reset() {
*x = IntegratedGradientsAttribution{}
if protoimpl.UnsafeEnabled {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IntegratedGradientsAttribution) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IntegratedGradientsAttribution) ProtoMessage() {}
func (x *IntegratedGradientsAttribution) ProtoReflect() protoreflect.Message {
mi := &file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IntegratedGradientsAttribution.ProtoReflect.Descriptor instead.
func (*IntegratedGradientsAttribution) Descriptor() ([]byte, []int) {
return file_mockgcp_cloud_aiplatform_v1beta1_explanation_proto_rawDescGZIP(), []int{7}
}
func (x *IntegratedGradientsAttribution) GetStepCount() int32 {
if x != nil {
return x.StepCount
}
return 0
}
func (x *IntegratedGradientsAttribution) GetSmoothGradConfig() *SmoothGradConfig {
if x != nil {
return x.SmoothGradConfig
}
return nil
}