Class: Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb

Overview

Visualization configurations for image explanation.

Defined Under Namespace

Modules: ColorMap, OverlayType, Polarity, Type

Instance Attribute Summary collapse

Instance Attribute Details

#clip_percent_lowerbound::Float

Returns Excludes attributions below the specified percentile, from the highlighted areas. Defaults to 62.

Returns:

  • (::Float)

    Excludes attributions below the specified percentile, from the highlighted areas. Defaults to 62.



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
# File 'proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb', line 235

class Visualization
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Type of the image visualization. Only applicable to
  # [Integrated Gradients
  # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution].
  module Type
    # Should not be used.
    TYPE_UNSPECIFIED = 0

    # Shows which pixel contributed to the image prediction.
    PIXELS = 1

    # Shows which region contributed to the image prediction by outlining
    # the region.
    OUTLINES = 2
  end

  # Whether to only highlight pixels with positive contributions, negative
  # or both. Defaults to POSITIVE.
  module Polarity
    # Default value. This is the same as POSITIVE.
    POLARITY_UNSPECIFIED = 0

    # Highlights the pixels/outlines that were most influential to the
    # model's prediction.
    POSITIVE = 1

    # Setting polarity to negative highlights areas that does not lead to
    # the models's current prediction.
    NEGATIVE = 2

    # Shows both positive and negative attributions.
    BOTH = 3
  end

  # The color scheme used for highlighting areas.
  module ColorMap
    # Should not be used.
    COLOR_MAP_UNSPECIFIED = 0

    # Positive: green. Negative: pink.
    PINK_GREEN = 1

    # Viridis color map: A perceptually uniform color mapping which is
    # easier to see by those with colorblindness and progresses from yellow
    # to green to blue. Positive: yellow. Negative: blue.
    VIRIDIS = 2

    # Positive: red. Negative: red.
    RED = 3

    # Positive: green. Negative: green.
    GREEN = 4

    # Positive: green. Negative: red.
    RED_GREEN = 6

    # PiYG palette.
    PINK_WHITE_GREEN = 5
  end

  # How the original image is displayed in the visualization.
  module OverlayType
    # Default value. This is the same as NONE.
    OVERLAY_TYPE_UNSPECIFIED = 0

    # No overlay.
    NONE = 1

    # The attributions are shown on top of the original image.
    ORIGINAL = 2

    # The attributions are shown on top of grayscaled version of the
    # original image.
    GRAYSCALE = 3

    # The attributions are used as a mask to reveal predictive parts of
    # the image and hide the un-predictive parts.
    MASK_BLACK = 4
  end
end

#clip_percent_upperbound::Float

Returns Excludes attributions above the specified percentile from the highlighted areas. Using the clip_percent_upperbound and clip_percent_lowerbound together can be useful for filtering out noise and making it easier to see areas of strong attribution. Defaults to 99.9.

Returns:

  • (::Float)

    Excludes attributions above the specified percentile from the highlighted areas. Using the clip_percent_upperbound and clip_percent_lowerbound together can be useful for filtering out noise and making it easier to see areas of strong attribution. Defaults to 99.9.



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
# File 'proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb', line 235

class Visualization
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Type of the image visualization. Only applicable to
  # [Integrated Gradients
  # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution].
  module Type
    # Should not be used.
    TYPE_UNSPECIFIED = 0

    # Shows which pixel contributed to the image prediction.
    PIXELS = 1

    # Shows which region contributed to the image prediction by outlining
    # the region.
    OUTLINES = 2
  end

  # Whether to only highlight pixels with positive contributions, negative
  # or both. Defaults to POSITIVE.
  module Polarity
    # Default value. This is the same as POSITIVE.
    POLARITY_UNSPECIFIED = 0

    # Highlights the pixels/outlines that were most influential to the
    # model's prediction.
    POSITIVE = 1

    # Setting polarity to negative highlights areas that does not lead to
    # the models's current prediction.
    NEGATIVE = 2

    # Shows both positive and negative attributions.
    BOTH = 3
  end

  # The color scheme used for highlighting areas.
  module ColorMap
    # Should not be used.
    COLOR_MAP_UNSPECIFIED = 0

    # Positive: green. Negative: pink.
    PINK_GREEN = 1

    # Viridis color map: A perceptually uniform color mapping which is
    # easier to see by those with colorblindness and progresses from yellow
    # to green to blue. Positive: yellow. Negative: blue.
    VIRIDIS = 2

    # Positive: red. Negative: red.
    RED = 3

    # Positive: green. Negative: green.
    GREEN = 4

    # Positive: green. Negative: red.
    RED_GREEN = 6

    # PiYG palette.
    PINK_WHITE_GREEN = 5
  end

  # How the original image is displayed in the visualization.
  module OverlayType
    # Default value. This is the same as NONE.
    OVERLAY_TYPE_UNSPECIFIED = 0

    # No overlay.
    NONE = 1

    # The attributions are shown on top of the original image.
    ORIGINAL = 2

    # The attributions are shown on top of grayscaled version of the
    # original image.
    GRAYSCALE = 3

    # The attributions are used as a mask to reveal predictive parts of
    # the image and hide the un-predictive parts.
    MASK_BLACK = 4
  end
end

#color_map::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::ColorMap

Returns The color scheme used for the highlighted areas.

Defaults to PINK_GREEN for [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], which shows positive attributions in green and negative in pink.

Defaults to VIRIDIS for [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], which highlights the most influential regions in yellow and the least influential in blue.

Returns:

  • (::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::ColorMap)

    The color scheme used for the highlighted areas.

    Defaults to PINK_GREEN for [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution], which shows positive attributions in green and negative in pink.

    Defaults to VIRIDIS for [XRAI attribution][google.cloud.aiplatform.v1.ExplanationParameters.xrai_attribution], which highlights the most influential regions in yellow and the least influential in blue.



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
# File 'proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb', line 235

class Visualization
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Type of the image visualization. Only applicable to
  # [Integrated Gradients
  # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution].
  module Type
    # Should not be used.
    TYPE_UNSPECIFIED = 0

    # Shows which pixel contributed to the image prediction.
    PIXELS = 1

    # Shows which region contributed to the image prediction by outlining
    # the region.
    OUTLINES = 2
  end

  # Whether to only highlight pixels with positive contributions, negative
  # or both. Defaults to POSITIVE.
  module Polarity
    # Default value. This is the same as POSITIVE.
    POLARITY_UNSPECIFIED = 0

    # Highlights the pixels/outlines that were most influential to the
    # model's prediction.
    POSITIVE = 1

    # Setting polarity to negative highlights areas that does not lead to
    # the models's current prediction.
    NEGATIVE = 2

    # Shows both positive and negative attributions.
    BOTH = 3
  end

  # The color scheme used for highlighting areas.
  module ColorMap
    # Should not be used.
    COLOR_MAP_UNSPECIFIED = 0

    # Positive: green. Negative: pink.
    PINK_GREEN = 1

    # Viridis color map: A perceptually uniform color mapping which is
    # easier to see by those with colorblindness and progresses from yellow
    # to green to blue. Positive: yellow. Negative: blue.
    VIRIDIS = 2

    # Positive: red. Negative: red.
    RED = 3

    # Positive: green. Negative: green.
    GREEN = 4

    # Positive: green. Negative: red.
    RED_GREEN = 6

    # PiYG palette.
    PINK_WHITE_GREEN = 5
  end

  # How the original image is displayed in the visualization.
  module OverlayType
    # Default value. This is the same as NONE.
    OVERLAY_TYPE_UNSPECIFIED = 0

    # No overlay.
    NONE = 1

    # The attributions are shown on top of the original image.
    ORIGINAL = 2

    # The attributions are shown on top of grayscaled version of the
    # original image.
    GRAYSCALE = 3

    # The attributions are used as a mask to reveal predictive parts of
    # the image and hide the un-predictive parts.
    MASK_BLACK = 4
  end
end

#overlay_type::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::OverlayType

Returns How the original image is displayed in the visualization. Adjusting the overlay can help increase visual clarity if the original image makes it difficult to view the visualization. Defaults to NONE.

Returns:



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
# File 'proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb', line 235

class Visualization
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Type of the image visualization. Only applicable to
  # [Integrated Gradients
  # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution].
  module Type
    # Should not be used.
    TYPE_UNSPECIFIED = 0

    # Shows which pixel contributed to the image prediction.
    PIXELS = 1

    # Shows which region contributed to the image prediction by outlining
    # the region.
    OUTLINES = 2
  end

  # Whether to only highlight pixels with positive contributions, negative
  # or both. Defaults to POSITIVE.
  module Polarity
    # Default value. This is the same as POSITIVE.
    POLARITY_UNSPECIFIED = 0

    # Highlights the pixels/outlines that were most influential to the
    # model's prediction.
    POSITIVE = 1

    # Setting polarity to negative highlights areas that does not lead to
    # the models's current prediction.
    NEGATIVE = 2

    # Shows both positive and negative attributions.
    BOTH = 3
  end

  # The color scheme used for highlighting areas.
  module ColorMap
    # Should not be used.
    COLOR_MAP_UNSPECIFIED = 0

    # Positive: green. Negative: pink.
    PINK_GREEN = 1

    # Viridis color map: A perceptually uniform color mapping which is
    # easier to see by those with colorblindness and progresses from yellow
    # to green to blue. Positive: yellow. Negative: blue.
    VIRIDIS = 2

    # Positive: red. Negative: red.
    RED = 3

    # Positive: green. Negative: green.
    GREEN = 4

    # Positive: green. Negative: red.
    RED_GREEN = 6

    # PiYG palette.
    PINK_WHITE_GREEN = 5
  end

  # How the original image is displayed in the visualization.
  module OverlayType
    # Default value. This is the same as NONE.
    OVERLAY_TYPE_UNSPECIFIED = 0

    # No overlay.
    NONE = 1

    # The attributions are shown on top of the original image.
    ORIGINAL = 2

    # The attributions are shown on top of grayscaled version of the
    # original image.
    GRAYSCALE = 3

    # The attributions are used as a mask to reveal predictive parts of
    # the image and hide the un-predictive parts.
    MASK_BLACK = 4
  end
end

#polarity::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::Polarity

Returns Whether to only highlight pixels with positive contributions, negative or both. Defaults to POSITIVE.

Returns:



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
# File 'proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb', line 235

class Visualization
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Type of the image visualization. Only applicable to
  # [Integrated Gradients
  # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution].
  module Type
    # Should not be used.
    TYPE_UNSPECIFIED = 0

    # Shows which pixel contributed to the image prediction.
    PIXELS = 1

    # Shows which region contributed to the image prediction by outlining
    # the region.
    OUTLINES = 2
  end

  # Whether to only highlight pixels with positive contributions, negative
  # or both. Defaults to POSITIVE.
  module Polarity
    # Default value. This is the same as POSITIVE.
    POLARITY_UNSPECIFIED = 0

    # Highlights the pixels/outlines that were most influential to the
    # model's prediction.
    POSITIVE = 1

    # Setting polarity to negative highlights areas that does not lead to
    # the models's current prediction.
    NEGATIVE = 2

    # Shows both positive and negative attributions.
    BOTH = 3
  end

  # The color scheme used for highlighting areas.
  module ColorMap
    # Should not be used.
    COLOR_MAP_UNSPECIFIED = 0

    # Positive: green. Negative: pink.
    PINK_GREEN = 1

    # Viridis color map: A perceptually uniform color mapping which is
    # easier to see by those with colorblindness and progresses from yellow
    # to green to blue. Positive: yellow. Negative: blue.
    VIRIDIS = 2

    # Positive: red. Negative: red.
    RED = 3

    # Positive: green. Negative: green.
    GREEN = 4

    # Positive: green. Negative: red.
    RED_GREEN = 6

    # PiYG palette.
    PINK_WHITE_GREEN = 5
  end

  # How the original image is displayed in the visualization.
  module OverlayType
    # Default value. This is the same as NONE.
    OVERLAY_TYPE_UNSPECIFIED = 0

    # No overlay.
    NONE = 1

    # The attributions are shown on top of the original image.
    ORIGINAL = 2

    # The attributions are shown on top of grayscaled version of the
    # original image.
    GRAYSCALE = 3

    # The attributions are used as a mask to reveal predictive parts of
    # the image and hide the un-predictive parts.
    MASK_BLACK = 4
  end
end

#type::Google::Cloud::AIPlatform::V1::ExplanationMetadata::InputMetadata::Visualization::Type

Returns Type of the image visualization. Only applicable to [Integrated Gradients attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution]. OUTLINES shows regions of attribution, while PIXELS shows per-pixel attribution. Defaults to OUTLINES.

Returns:



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
# File 'proto_docs/google/cloud/aiplatform/v1/explanation_metadata.rb', line 235

class Visualization
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Type of the image visualization. Only applicable to
  # [Integrated Gradients
  # attribution][google.cloud.aiplatform.v1.ExplanationParameters.integrated_gradients_attribution].
  module Type
    # Should not be used.
    TYPE_UNSPECIFIED = 0

    # Shows which pixel contributed to the image prediction.
    PIXELS = 1

    # Shows which region contributed to the image prediction by outlining
    # the region.
    OUTLINES = 2
  end

  # Whether to only highlight pixels with positive contributions, negative
  # or both. Defaults to POSITIVE.
  module Polarity
    # Default value. This is the same as POSITIVE.
    POLARITY_UNSPECIFIED = 0

    # Highlights the pixels/outlines that were most influential to the
    # model's prediction.
    POSITIVE = 1

    # Setting polarity to negative highlights areas that does not lead to
    # the models's current prediction.
    NEGATIVE = 2

    # Shows both positive and negative attributions.
    BOTH = 3
  end

  # The color scheme used for highlighting areas.
  module ColorMap
    # Should not be used.
    COLOR_MAP_UNSPECIFIED = 0

    # Positive: green. Negative: pink.
    PINK_GREEN = 1

    # Viridis color map: A perceptually uniform color mapping which is
    # easier to see by those with colorblindness and progresses from yellow
    # to green to blue. Positive: yellow. Negative: blue.
    VIRIDIS = 2

    # Positive: red. Negative: red.
    RED = 3

    # Positive: green. Negative: green.
    GREEN = 4

    # Positive: green. Negative: red.
    RED_GREEN = 6

    # PiYG palette.
    PINK_WHITE_GREEN = 5
  end

  # How the original image is displayed in the visualization.
  module OverlayType
    # Default value. This is the same as NONE.
    OVERLAY_TYPE_UNSPECIFIED = 0

    # No overlay.
    NONE = 1

    # The attributions are shown on top of the original image.
    ORIGINAL = 2

    # The attributions are shown on top of grayscaled version of the
    # original image.
    GRAYSCALE = 3

    # The attributions are used as a mask to reveal predictive parts of
    # the image and hide the un-predictive parts.
    MASK_BLACK = 4
  end
end