(
        self, group_size, initial_temperature=1.0, is_temperature_trainable=True
    )
Computes a soft nearest neighbor point cloud.
        Arguments:
            group_size: An integer, number of neighbors in nearest neighborhood.
            initial_temperature: A positive real number, initialization constant for temperature parameter.
            is_temperature_trainable: bool.
        Inputs:
            point_cloud: A `Tensor` of shape (batch_size, num_in_points, 3), original point cloud.
            query_cloud: A `Tensor` of shape (batch_size, num_out_points, 3), generated point cloud
        Outputs:
            projected_point_cloud: A `Tensor` of shape (batch_size, num_out_points, 3),
                the query_cloud projected onto its group_size nearest neighborhood,
                controlled by the learnable temperature parameter.
            weights: A `Tensor` of shape (batch_size, num_out_points, group_size, 1),
                the projection weights of the query_cloud onto its group_size nearest neighborhood
            dist: A `Tensor` of shape (batch_size, num_out_points, group_size, 1),
                the square distance of each query point from its neighbors divided by squared temperature parameter
Computes a soft nearest neighbor point cloud.
        Arguments:
            group_size: An integer, number of neighbors in nearest neighborhood.
            initial_temperature: A positive real number, initialization constant for temperature parameter.
            is_temperature_trainable: bool.
        Inputs:
            point_cloud: A `Tensor` of shape (batch_size, num_in_points, 3), original point cloud.
            query_cloud: A `Tensor` of shape (batch_size, num_out_points, 3), generated point cloud
        Outputs:
            projected_point_cloud: A `Tensor` of shape (batch_size, num_out_points, 3),
                the query_cloud projected onto its group_size nearest neighborhood,
                controlled by the learnable temperature parameter.
            weights: A `Tensor` of shape (batch_size, num_out_points, group_size, 1),
                the projection weights of the query_cloud onto its group_size nearest neighborhood
            dist: A `Tensor` of shape (batch_size, num_out_points, group_size, 1),
                the square distance of each query point from its neighbors divided by squared temperature parameter
Computes a soft nearest neighbor point cloud . Arguments : group_size : An integer number of neighbors in nearest neighborhood . initial_temperature : A positive real number initialization constant for temperature parameter . is_temperature_trainable : bool . Inputs : point_cloud : A Tensor of shape ( batch_size num_in_points 3 ) original point cloud . query_cloud : A Tensor of shape ( batch_size num_out_points 3 ) generated point cloud Outputs : projected_point_cloud : A Tensor of shape ( batch_size num_out_points 3 ) the query_cloud projected onto its group_size nearest neighborhood controlled by the learnable temperature parameter . weights : A Tensor of shape ( batch_size num_out_points group_size 1 ) the projection weights of the query_cloud onto its group_size nearest neighborhood dist : A Tensor of shape ( batch_size num_out_points group_size 1 ) the square distance of each query point from its neighbors divided by squared temperature parameter
def __init__(
        self, group_size, initial_temperature=1.0, is_temperature_trainable=True
    ):
        """Computes a soft nearest neighbor point cloud.
        Arguments:
            group_size: An integer, number of neighbors in nearest neighborhood.
            initial_temperature: A positive real number, initialization constant for temperature parameter.
            is_temperature_trainable: bool.
        Inputs:
            point_cloud: A `Tensor` of shape (batch_size, num_in_points, 3), original point cloud.
            query_cloud: A `Tensor` of shape (batch_size, num_out_points, 3), generated point cloud
        Outputs:
            projected_point_cloud: A `Tensor` of shape (batch_size, num_out_points, 3),
                the query_cloud projected onto its group_size nearest neighborhood,
                controlled by the learnable temperature parameter.
            weights: A `Tensor` of shape (batch_size, num_out_points, group_size, 1),
                the projection weights of the query_cloud onto its group_size nearest neighborhood
            dist: A `Tensor` of shape (batch_size, num_out_points, group_size, 1),
                the square distance of each query point from its neighbors divided by squared temperature parameter
        """

        self._group_size = group_size

        # create temperature variable
        self._temperature = tf.get_variable(
            "temperature",
            initializer=tf.constant(initial_temperature, dtype=tf.float32),
            trainable=is_temperature_trainable,
            dtype=tf.float32,
        )

        self._temperature_safe = tf.maximum(self._temperature, 1e-2)

        # sigma is exposed for loss calculation
        self.sigma = self._temperature_safe ** 2
def __init__ ( self , group_size , initial_temperature = 1.0 , is_temperature_trainable = True ) : self . _group_size = group_size # create temperature variable self . _temperature = tf . get_variable ( "temperature" , initializer = tf . constant ( initial_temperature , dtype = tf . float32 ) , trainable = is_temperature_trainable , dtype = tf . float32 , ) self . _temperature_safe = tf . maximum ( self . _temperature , 1e-2 ) # sigma is exposed for loss calculation self . sigma = self . _temperature_safe ** 2