Class SmoothGradConfig.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<SmoothGradConfig.Builder>
com.google.cloud.aiplatform.v1.SmoothGradConfig.Builder
All Implemented Interfaces:
SmoothGradConfigOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
SmoothGradConfig

public static final class SmoothGradConfig.Builder extends com.google.protobuf.GeneratedMessage.Builder<SmoothGradConfig.Builder> implements SmoothGradConfigOrBuilder
 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
 
Protobuf type google.cloud.aiplatform.v1.SmoothGradConfig
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<SmoothGradConfig.Builder>
    • clear

      public SmoothGradConfig.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<SmoothGradConfig.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<SmoothGradConfig.Builder>
    • getDefaultInstanceForType

      public SmoothGradConfig getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public SmoothGradConfig build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public SmoothGradConfig buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public SmoothGradConfig.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SmoothGradConfig.Builder>
    • mergeFrom

      public SmoothGradConfig.Builder mergeFrom(SmoothGradConfig other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<SmoothGradConfig.Builder>
    • mergeFrom

      public SmoothGradConfig.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SmoothGradConfig.Builder>
      Throws:
      IOException
    • getGradientNoiseSigmaCase

      public SmoothGradConfig.GradientNoiseSigmaCase getGradientNoiseSigmaCase()
      Specified by:
      getGradientNoiseSigmaCase in interface SmoothGradConfigOrBuilder
    • clearGradientNoiseSigma

      public SmoothGradConfig.Builder clearGradientNoiseSigma()
    • hasNoiseSigma

      public boolean hasNoiseSigma()
       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.
       
      float noise_sigma = 1;
      Specified by:
      hasNoiseSigma in interface SmoothGradConfigOrBuilder
      Returns:
      Whether the noiseSigma field is set.
    • getNoiseSigma

      public float getNoiseSigma()
       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.
       
      float noise_sigma = 1;
      Specified by:
      getNoiseSigma in interface SmoothGradConfigOrBuilder
      Returns:
      The noiseSigma.
    • setNoiseSigma

      public SmoothGradConfig.Builder setNoiseSigma(float value)
       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.
       
      float noise_sigma = 1;
      Parameters:
      value - The noiseSigma to set.
      Returns:
      This builder for chaining.
    • clearNoiseSigma

      public SmoothGradConfig.Builder clearNoiseSigma()
       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.
       
      float noise_sigma = 1;
      Returns:
      This builder for chaining.
    • hasFeatureNoiseSigma

      public boolean hasFeatureNoiseSigma()
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
      Specified by:
      hasFeatureNoiseSigma in interface SmoothGradConfigOrBuilder
      Returns:
      Whether the featureNoiseSigma field is set.
    • getFeatureNoiseSigma

      public FeatureNoiseSigma getFeatureNoiseSigma()
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
      Specified by:
      getFeatureNoiseSigma in interface SmoothGradConfigOrBuilder
      Returns:
      The featureNoiseSigma.
    • setFeatureNoiseSigma

      public SmoothGradConfig.Builder setFeatureNoiseSigma(FeatureNoiseSigma value)
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
    • setFeatureNoiseSigma

      public SmoothGradConfig.Builder setFeatureNoiseSigma(FeatureNoiseSigma.Builder builderForValue)
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
    • mergeFeatureNoiseSigma

      public SmoothGradConfig.Builder mergeFeatureNoiseSigma(FeatureNoiseSigma value)
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
    • clearFeatureNoiseSigma

      public SmoothGradConfig.Builder clearFeatureNoiseSigma()
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
    • getFeatureNoiseSigmaBuilder

      public FeatureNoiseSigma.Builder getFeatureNoiseSigmaBuilder()
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
    • getFeatureNoiseSigmaOrBuilder

      public FeatureNoiseSigmaOrBuilder getFeatureNoiseSigmaOrBuilder()
       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.
       
      .google.cloud.aiplatform.v1.FeatureNoiseSigma feature_noise_sigma = 2;
      Specified by:
      getFeatureNoiseSigmaOrBuilder in interface SmoothGradConfigOrBuilder
    • getNoisySampleCount

      public int getNoisySampleCount()
       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.
       
      int32 noisy_sample_count = 3;
      Specified by:
      getNoisySampleCount in interface SmoothGradConfigOrBuilder
      Returns:
      The noisySampleCount.
    • setNoisySampleCount

      public SmoothGradConfig.Builder setNoisySampleCount(int value)
       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.
       
      int32 noisy_sample_count = 3;
      Parameters:
      value - The noisySampleCount to set.
      Returns:
      This builder for chaining.
    • clearNoisySampleCount

      public SmoothGradConfig.Builder clearNoisySampleCount()
       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.
       
      int32 noisy_sample_count = 3;
      Returns:
      This builder for chaining.