box_embeddings.modules.intersection.tf_gumbel_intersection

Module Contents

tf_gumbel_intersection(left: box_embeddings.parameterizations.TFTBoxTensor, right: box_embeddings.parameterizations.TFTBoxTensor, gumbel_beta: float = 1.0, approximation_mode: Optional[str] = None) box_embeddings.parameterizations.TFTBoxTensor

Hard Intersection operation as a function.

Note

This function can give fipped boxes, i.e. where z[i] > Z[i]

Parameters
  • left – BoxTensor which is the left operand

  • right – BoxTensor which is the right operand

  • gumbel_beta – Beta parameter

  • approximation_mode – Use hard clipping (‘clipping’) or hard clipping with separeate value for forward and backward passes (‘clipping_forward’) to satisfy the required inequalities. Set None to not use any approximation. (default: None)

Returns

The resulting BoxTensor obtained by interection. It has the same concrete type as the self (left operand).

Raises

ValueError – When approximation_mode is not in [None, ‘clipping’, ‘clipping_forward’]

class TFGumbelIntersection(beta: float = 1.0, approximation_mode: Optional[str] = None)

Bases: box_embeddings.modules.intersection._tf_intersection._TFIntersection

Gumbel intersection operation as a Layer/Module.

Performs the intersection operation as described in Improving Local Identifiability in Probabilistic Box Embeddings .