_utils¶
Attributes¶
Exceptions¶
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
Classes¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Like format(obj, fmt), but returns the string 'None' if obj is None. |
|
Module Contents¶
- _utils.Strategy¶
- _utils.Queue¶
- _utils.SpatialSearch¶
- _utils.ResponsibilityStyle¶
- _utils.update_mask_shape(batch_size, mask_shape)¶
- class _utils.ReXPositions(sufficient_position=None, contrastive_position=None, sufficiency_found=False, current_max_necessity=0.0)¶
- sufficient_position = None¶
- contrastive_position = None¶
- sufficiency_found = False¶
- current_max_necessity = 0.0¶
- is_empty()¶
- _utils.find_required_prediction(target, threshold, insertion_predictions, contrastive_completeness_threshold=0.0, deletion_predictions=None, rounding=None, sufficiency_found=False)¶
- _utils.find_complete_prediction(target, target_confidence, insertion_predictions, rounding=2)¶
- Parameters:
target (int)
insertion_predictions (List[rex_xai.responsibility.prediction.Prediction])
- _utils.try_detach(t)¶
- Return type:
numpy.ndarray
- _utils.one_d_permute(tensor)¶
- _utils.powerset(r, reverse=True)¶
- exception _utils.ReXTomlError(message)¶
Bases:
ReXErrorCommon base class for all non-exit exceptions.
- message¶
- exception _utils.ReXPathError(message)¶
Bases:
ReXErrorCommon base class for all non-exit exceptions.
- message¶
- exception _utils.ReXScriptError(message)¶
Bases:
ReXErrorCommon base class for all non-exit exceptions.
- message¶
- exception _utils.ReXDataError(message)¶
Bases:
ReXErrorCommon base class for all non-exit exceptions.
- message¶
- exception _utils.ReXMapError(message)¶
Bases:
ReXErrorCommon base class for all non-exit exceptions.
- message¶
- _utils.xlogx(ps)¶
- _utils._xlogx(p)¶
- _utils.add_boundaries(img, segs, colour=None)¶
- Parameters:
img (Union[numpy.typing.NDArray, torch.Tensor])
segs (numpy.typing.NDArray)
- Return type:
numpy.typing.NDArray
- _utils.get_map_locations(map, reverse=True)¶
- _utils.set_boolean_mask_value(tensor, mode, order, coords, val=True)¶
- Parameters:
coords (Union[rex_xai.mutants.box.Box, Tuple[numpy.typing.NDArray, numpy.typing.NDArray]])
val (bool)
- _utils.ff(obj, fmt)¶
Like format(obj, fmt), but returns the string ‘None’ if obj is None. See the help for format() to see acceptable values for fmt.
- _utils.version()¶