Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1SmoothGradConfig
- Inherits:
-
Object
- Object
- Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1SmoothGradConfig
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/aiplatform_v1beta1/classes.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb
Overview
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
Instance Attribute Summary collapse
-
#feature_noise_sigma ⇒ Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1FeatureNoiseSigma
Noise sigma by features.
-
#noise_sigma ⇒ Float
This is a single float value and will be used to add noise to all the features.
-
#noisy_sample_count ⇒ Fixnum
The number of gradient samples to use for approximation.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1SmoothGradConfig
constructor
A new instance of GoogleCloudAiplatformV1beta1SmoothGradConfig.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1SmoothGradConfig
Returns a new instance of GoogleCloudAiplatformV1beta1SmoothGradConfig.
31718 31719 31720 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 31718 def initialize(**args) update!(**args) end |
Instance Attribute Details
#feature_noise_sigma ⇒ Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1FeatureNoiseSigma
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.
Corresponds to the JSON property featureNoiseSigma
31695 31696 31697 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 31695 def feature_noise_sigma @feature_noise_sigma end |
#noise_sigma ⇒ Float
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. 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 instead for each feature.
Corresponds to the JSON property noiseSigma
31708 31709 31710 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 31708 def noise_sigma @noise_sigma end |
#noisy_sample_count ⇒ Fixnum
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.
Corresponds to the JSON property noisySampleCount
31716 31717 31718 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 31716 def noisy_sample_count @noisy_sample_count end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
31723 31724 31725 31726 31727 |
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 31723 def update!(**args) @feature_noise_sigma = args[:feature_noise_sigma] if args.key?(:feature_noise_sigma) @noise_sigma = args[:noise_sigma] if args.key?(:noise_sigma) @noisy_sample_count = args[:noisy_sample_count] if args.key?(:noisy_sample_count) end |