:py:mod:`box_embeddings.modules.volume.bessel_volume` ===================================================== .. py:module:: box_embeddings.modules.volume.bessel_volume Module Contents --------------- .. py:data:: eps .. py:data:: euler_gamma .. py:function:: bessel_volume_approx(box_tensor: box_embeddings.parameterizations.box_tensor.BoxTensor, volume_temperature: float = 1.0, intersection_temperature: float = 1.0, log_scale: bool = True, scale: float = 1.0) -> torch.Tensor Volume of boxes. Uses the Softplus as an approximation of Bessel funtion. :param box_tensor: input :param volume_temperature: 1/volume_temperature is the beta parameter for the softplus :param intersection_temperature: the intersection_temperature parameter (same value used in intersection). :param log_scale: Whether the output should be in log scale or not. :param scale: scale parameter. Should be left as 1.0 (default) in most cases. :returns: Tensor of shape (..., ) when self has shape (..., 2, num_dims) :raises ValueError: if scale not in (0,1] or volume_temperature is 0. .. py:class:: BesselApproxVolume(log_scale: bool = True, volume_temperature: float = 1.0, intersection_temperature: float = 1.0) Bases: :py:obj:`box_embeddings.modules.volume._volume._Volume` Uses the Softplus as an approximation of Bessel function. .. py:method:: forward(self, box_tensor: box_embeddings.parameterizations.box_tensor.BoxTensor) -> torch.Tensor Soft softplus base (instead of ReLU) volume. :param box_tensor: TODO :returns: torch.Tensor