#[non_exhaustive]pub struct IntegratedGradientsAttribution {
pub step_count: i32,
pub smooth_grad_config: Option<SmoothGradConfig>,
pub blur_baseline_config: Option<BlurBaselineConfig>,
/* private fields */
}dataset-service or deployment-resource-pool-service or endpoint-service or job-service or model-service or pipeline-service or prediction-service only.Expand description
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
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.step_count: i32Required. 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.
smooth_grad_config: Option<SmoothGradConfig>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
blur_baseline_config: Option<BlurBaselineConfig>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
Implementations§
Source§impl IntegratedGradientsAttribution
impl IntegratedGradientsAttribution
pub fn new() -> Self
Sourcepub fn set_step_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_step_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of step_count.
§Example
let x = IntegratedGradientsAttribution::new().set_step_count(42);Sourcepub fn set_smooth_grad_config<T>(self, v: T) -> Selfwhere
T: Into<SmoothGradConfig>,
pub fn set_smooth_grad_config<T>(self, v: T) -> Selfwhere
T: Into<SmoothGradConfig>,
Sets the value of smooth_grad_config.
§Example
use google_cloud_aiplatform_v1::model::SmoothGradConfig;
let x = IntegratedGradientsAttribution::new().set_smooth_grad_config(SmoothGradConfig::default()/* use setters */);Sourcepub fn set_or_clear_smooth_grad_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SmoothGradConfig>,
pub fn set_or_clear_smooth_grad_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SmoothGradConfig>,
Sets or clears the value of smooth_grad_config.
§Example
use google_cloud_aiplatform_v1::model::SmoothGradConfig;
let x = IntegratedGradientsAttribution::new().set_or_clear_smooth_grad_config(Some(SmoothGradConfig::default()/* use setters */));
let x = IntegratedGradientsAttribution::new().set_or_clear_smooth_grad_config(None::<SmoothGradConfig>);Sourcepub fn set_blur_baseline_config<T>(self, v: T) -> Selfwhere
T: Into<BlurBaselineConfig>,
pub fn set_blur_baseline_config<T>(self, v: T) -> Selfwhere
T: Into<BlurBaselineConfig>,
Sets the value of blur_baseline_config.
§Example
use google_cloud_aiplatform_v1::model::BlurBaselineConfig;
let x = IntegratedGradientsAttribution::new().set_blur_baseline_config(BlurBaselineConfig::default()/* use setters */);Sourcepub fn set_or_clear_blur_baseline_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<BlurBaselineConfig>,
pub fn set_or_clear_blur_baseline_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<BlurBaselineConfig>,
Sets or clears the value of blur_baseline_config.
§Example
use google_cloud_aiplatform_v1::model::BlurBaselineConfig;
let x = IntegratedGradientsAttribution::new().set_or_clear_blur_baseline_config(Some(BlurBaselineConfig::default()/* use setters */));
let x = IntegratedGradientsAttribution::new().set_or_clear_blur_baseline_config(None::<BlurBaselineConfig>);Trait Implementations§
Source§impl Clone for IntegratedGradientsAttribution
impl Clone for IntegratedGradientsAttribution
Source§fn clone(&self) -> IntegratedGradientsAttribution
fn clone(&self) -> IntegratedGradientsAttribution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for IntegratedGradientsAttribution
impl Default for IntegratedGradientsAttribution
Source§fn default() -> IntegratedGradientsAttribution
fn default() -> IntegratedGradientsAttribution
Source§impl PartialEq for IntegratedGradientsAttribution
impl PartialEq for IntegratedGradientsAttribution
Source§fn eq(&self, other: &IntegratedGradientsAttribution) -> bool
fn eq(&self, other: &IntegratedGradientsAttribution) -> bool
self and other values to be equal, and is used by ==.