/
explanation.pb.go
1716 lines (1552 loc) · 76.8 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 2021 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.26.0
// protoc v3.12.2
// source: google/cloud/aiplatform/v1/explanation.proto
package aiplatform
import (
reflect "reflect"
sync "sync"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
structpb "google.golang.org/protobuf/types/known/structpb"
)
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)
)
// Explanation of a prediction (provided in [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions])
// produced by the Model on a given [instance][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.Attribution.output_index] can be used to identify which
// output this attribution is explaining.
//
// If users set [ExplanationParameters.top_k][google.cloud.aiplatform.v1.ExplanationParameters.top_k], the attributions are sorted
// by [instance_output_value][Attributions.instance_output_value] in
// descending order. If [ExplanationParameters.output_indices][google.cloud.aiplatform.v1.ExplanationParameters.output_indices] is specified,
// the attributions are stored by [Attribution.output_index][google.cloud.aiplatform.v1.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"`
}
func (x *Explanation) Reset() {
*x = Explanation{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_aiplatform_v1_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_google_cloud_aiplatform_v1_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_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{0}
}
func (x *Explanation) GetAttributions() []*Attribution {
if x != nil {
return x.Attributions
}
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][google.cloud.aiplatform.v1.Attribution.output_index] can be used to identify which
// output this attribution is explaining.
//
// The [baselineOutputValue][google.cloud.aiplatform.v1.Attribution.baseline_output_value],
// [instanceOutputValue][google.cloud.aiplatform.v1.Attribution.instance_output_value] and
// [featureAttributions][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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_google_cloud_aiplatform_v1_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_google_cloud_aiplatform_v1_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_google_cloud_aiplatform_v1_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][google.cloud.aiplatform.v1.ExplanationMetadata.inputs].
// The field name of the output is determined by the key in
// [ExplanationMetadata.outputs][google.cloud.aiplatform.v1.ExplanationMetadata.outputs].
//
// If the Model's predicted output has multiple dimensions (rank > 1), this is
// the value in the output located by [output_index][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.ExplanationMetadata.outputs].
//
// If the Model predicted output has multiple dimensions, this is the value in
// the output located by [output_index][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.ExplainRequest.instances] according to
// [explanation metadata for inputs][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.ExplanationMetadata.feature_attributions_schema_uri] field,
// pointed to by the [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] field of the
// [Endpoint.deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] object, points to the schema file that
// describes the features and their attribution values (if it is populated).
FeatureAttributions *structpb.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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.Attribution.feature_attributions] caused by approximation used in the
// explanation method. Lower value means more precise attributions.
//
// * For Sampled Shapley
// [attribution][google.cloud.aiplatform.v1.ExplanationParameters.sampled_shapley_attribution],
// increasing [path_count][google.cloud.aiplatform.v1.SampledShapleyAttribution.path_count] might reduce
// the error.
// * For Integrated Gradients
// [attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution],
// increasing [step_count][google.cloud.aiplatform.v1.IntegratedGradientsAttribution.step_count] might
// reduce the error.
// * For [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution],
// increasing
// [step_count][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.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_google_cloud_aiplatform_v1_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_google_cloud_aiplatform_v1_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_google_cloud_aiplatform_v1_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() *structpb.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 ""
}
// 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"`
// Required. 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_google_cloud_aiplatform_v1_explanation_proto_msgTypes[3]
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_google_cloud_aiplatform_v1_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 ExplanationSpec.ProtoReflect.Descriptor instead.
func (*ExplanationSpec) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{3}
}
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
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][google.cloud.aiplatform.v1.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][google.cloud.aiplatform.v1.ExplanationParameters.top_k] indices of outputs.
// If neither top_k nor output_indeices 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 *structpb.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_google_cloud_aiplatform_v1_explanation_proto_msgTypes[4]
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_google_cloud_aiplatform_v1_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 ExplanationParameters.ProtoReflect.Descriptor instead.
func (*ExplanationParameters) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{4}
}
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) GetTopK() int32 {
if x != nil {
return x.TopK
}
return 0
}
func (x *ExplanationParameters) GetOutputIndices() *structpb.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"`
}
func (*ExplanationParameters_SampledShapleyAttribution) isExplanationParameters_Method() {}
func (*ExplanationParameters_IntegratedGradientsAttribution) isExplanationParameters_Method() {}
func (*ExplanationParameters_XraiAttribution) 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_google_cloud_aiplatform_v1_explanation_proto_msgTypes[5]
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_google_cloud_aiplatform_v1_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 SampledShapleyAttribution.ProtoReflect.Descriptor instead.
func (*SampledShapleyAttribution) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{5}
}
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_google_cloud_aiplatform_v1_explanation_proto_msgTypes[6]
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_google_cloud_aiplatform_v1_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 IntegratedGradientsAttribution.ProtoReflect.Descriptor instead.
func (*IntegratedGradientsAttribution) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{6}
}
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
}
func (x *IntegratedGradientsAttribution) GetBlurBaselineConfig() *BlurBaselineConfig {
if x != nil {
return x.BlurBaselineConfig
}
return nil
}
// An explanation method that redistributes Integrated Gradients
// attributions 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
//
// Supported only by image Models.
type XraiAttribution 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 met 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 XRAI 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 *XraiAttribution) Reset() {
*x = XraiAttribution{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *XraiAttribution) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*XraiAttribution) ProtoMessage() {}
func (x *XraiAttribution) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_aiplatform_v1_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 XraiAttribution.ProtoReflect.Descriptor instead.
func (*XraiAttribution) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{7}
}
func (x *XraiAttribution) GetStepCount() int32 {
if x != nil {
return x.StepCount
}
return 0
}
func (x *XraiAttribution) GetSmoothGradConfig() *SmoothGradConfig {
if x != nil {
return x.SmoothGradConfig
}
return nil
}
func (x *XraiAttribution) GetBlurBaselineConfig() *BlurBaselineConfig {
if x != nil {
return x.BlurBaselineConfig
}
return nil
}
// 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
type SmoothGradConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Represents the standard deviation of the gaussian kernel
// that will be used to add noise to the interpolated inputs
// prior to computing gradients.
//
// Types that are assignable to GradientNoiseSigma:
// *SmoothGradConfig_NoiseSigma
// *SmoothGradConfig_FeatureNoiseSigma
GradientNoiseSigma isSmoothGradConfig_GradientNoiseSigma `protobuf_oneof:"GradientNoiseSigma"`
// The number of gradient samples to use for
// approximation. The higher this number, the more accurate the gradient
// is, but the runtime complexity increases by this factor as well.
// Valid range of its value is [1, 50]. Defaults to 3.
NoisySampleCount int32 `protobuf:"varint,3,opt,name=noisy_sample_count,json=noisySampleCount,proto3" json:"noisy_sample_count,omitempty"`
}
func (x *SmoothGradConfig) Reset() {
*x = SmoothGradConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SmoothGradConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SmoothGradConfig) ProtoMessage() {}
func (x *SmoothGradConfig) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[8]
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 SmoothGradConfig.ProtoReflect.Descriptor instead.
func (*SmoothGradConfig) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{8}
}
func (m *SmoothGradConfig) GetGradientNoiseSigma() isSmoothGradConfig_GradientNoiseSigma {
if m != nil {
return m.GradientNoiseSigma
}
return nil
}
func (x *SmoothGradConfig) GetNoiseSigma() float32 {
if x, ok := x.GetGradientNoiseSigma().(*SmoothGradConfig_NoiseSigma); ok {
return x.NoiseSigma
}
return 0
}
func (x *SmoothGradConfig) GetFeatureNoiseSigma() *FeatureNoiseSigma {
if x, ok := x.GetGradientNoiseSigma().(*SmoothGradConfig_FeatureNoiseSigma); ok {
return x.FeatureNoiseSigma
}
return nil
}
func (x *SmoothGradConfig) GetNoisySampleCount() int32 {
if x != nil {
return x.NoisySampleCount
}
return 0
}
type isSmoothGradConfig_GradientNoiseSigma interface {
isSmoothGradConfig_GradientNoiseSigma()
}
type SmoothGradConfig_NoiseSigma struct {
// This is a single float value and will be used to add noise to all the
// features. Use this field when all features are normalized to have the
// same distribution: scale to range [0, 1], [-1, 1] or z-scoring, where
// features are normalized to have 0-mean and 1-variance. Learn more about
// [normalization](https://developers.google.com/machine-learning/data-prep/transform/normalization).
//
// For best results the recommended value is about 10% - 20% of the standard
// deviation of the input feature. Refer to section 3.2 of the SmoothGrad
// paper: https://arxiv.org/pdf/1706.03825.pdf. Defaults to 0.1.
//
// If the distribution is different per feature, set
// [feature_noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.feature_noise_sigma] instead
// for each feature.
NoiseSigma float32 `protobuf:"fixed32,1,opt,name=noise_sigma,json=noiseSigma,proto3,oneof"`
}
type SmoothGradConfig_FeatureNoiseSigma struct {
// This is similar to [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma], but
// provides additional flexibility. A separate noise sigma can be provided
// for each feature, which is useful if their distributions are different.
// No noise is added to features that are not set. If this field is unset,
// [noise_sigma][google.cloud.aiplatform.v1.SmoothGradConfig.noise_sigma] will be used for all
// features.
FeatureNoiseSigma *FeatureNoiseSigma `protobuf:"bytes,2,opt,name=feature_noise_sigma,json=featureNoiseSigma,proto3,oneof"`
}
func (*SmoothGradConfig_NoiseSigma) isSmoothGradConfig_GradientNoiseSigma() {}
func (*SmoothGradConfig_FeatureNoiseSigma) isSmoothGradConfig_GradientNoiseSigma() {}
// Noise sigma by features. Noise sigma represents the standard deviation of the
// gaussian kernel that will be used to add noise to interpolated inputs prior
// to computing gradients.
type FeatureNoiseSigma struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Noise sigma per feature. No noise is added to features that are not set.
NoiseSigma []*FeatureNoiseSigma_NoiseSigmaForFeature `protobuf:"bytes,1,rep,name=noise_sigma,json=noiseSigma,proto3" json:"noise_sigma,omitempty"`
}
func (x *FeatureNoiseSigma) Reset() {
*x = FeatureNoiseSigma{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FeatureNoiseSigma) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FeatureNoiseSigma) ProtoMessage() {}
func (x *FeatureNoiseSigma) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[9]
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 FeatureNoiseSigma.ProtoReflect.Descriptor instead.
func (*FeatureNoiseSigma) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{9}
}
func (x *FeatureNoiseSigma) GetNoiseSigma() []*FeatureNoiseSigma_NoiseSigmaForFeature {
if x != nil {
return x.NoiseSigma
}
return nil
}
// Config for 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
type BlurBaselineConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The standard deviation of the blur kernel for the blurred baseline. The
// same blurring parameter is used for both the height and the width
// dimension. If not set, the method defaults to the zero (i.e. black for
// images) baseline.
MaxBlurSigma float32 `protobuf:"fixed32,1,opt,name=max_blur_sigma,json=maxBlurSigma,proto3" json:"max_blur_sigma,omitempty"`
}
func (x *BlurBaselineConfig) Reset() {
*x = BlurBaselineConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BlurBaselineConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BlurBaselineConfig) ProtoMessage() {}
func (x *BlurBaselineConfig) ProtoReflect() protoreflect.Message {
mi := &file_google_cloud_aiplatform_v1_explanation_proto_msgTypes[10]
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 BlurBaselineConfig.ProtoReflect.Descriptor instead.
func (*BlurBaselineConfig) Descriptor() ([]byte, []int) {
return file_google_cloud_aiplatform_v1_explanation_proto_rawDescGZIP(), []int{10}
}
func (x *BlurBaselineConfig) GetMaxBlurSigma() float32 {
if x != nil {
return x.MaxBlurSigma
}
return 0
}
// The [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] entries that can be overridden at
// [online explanation][google.cloud.aiplatform.v1.PredictionService.Explain] time.
type ExplanationSpecOverride struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The parameters to be overridden. Note that the
// [method][google.cloud.aiplatform.v1.ExplanationParameters.method] cannot be changed. If not specified,
// no parameter is overridden.