代码学习_KPConv_models.blocks

本文是作者关于深度学习中KPConv模型的学习笔记,主要关注点在于KPConv模块的初始化、邻居点的选择及其特征计算过程。介绍了如何从点云数据中选取邻域点,计算点与核的距离,应用核函数进行特征加权,以及最终的特征归一化。文中还提及了邻居点的选取方法,但表示这一部分有待进一步学习。
摘要由CSDN通过智能技术生成

代码学习_KPConv_models.blocks

文章只是个人学习过程中的记录,因水平极其有限,仅供参考,欢迎一起交流

class KPConv(nn.Module)

  • 初始化赋值
  • 创建kernel points: K_points_numpy
        # Initialize weights  [n_kpoints, in_fdim, out_fdim]
        self.weights = Parameter(torch.zeros((self.K, in_channels, out_channels), dtype=torch.float32),
                                 requires_grad=True)
                                 
		# Initialize kernel points  [num_kpoints, dimension=3]
        self.kernel_points = Parameter(torch.tensor(K_points_numpy, dtype=torch.float32),
                         requires_grad=False)
  • 对于点云中某点x,取出其邻域内的点,并与自身作差 ~ y_i
    • 细节见附1
  • 计算其与 kernel 的距离的平方 ~ sq_distances
        # Get neighbor points
        neighbors = s_pts[neighb_inds, :]  # [n_points, n_neighbors, dim]

        # Center every neighborhood
        neighbors = neighbors - q_pts.unsqueeze_(1)  # [n_points, n_neighbors, dim]

        # kernel_points [num_kpoints, dim=3]
        deformed_K_points = self.kernel_points # [num_kpoints, dim]

        # Get all difference matrices [n_points, n_neighbors, n_kpoints, dim]
        neighbors.unsqueeze_(2)
        differences = neighbors - deformed_K_points

        # Get the square distances [n_points, n_neighbors, n_kpoints]
        sq_distances = torch.sum
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值