當前位置: 首頁>>代碼示例>>Python>>正文


Python pytorch_utils.SharedMLP方法代碼示例

本文整理匯總了Python中pytorch_utils.SharedMLP方法的典型用法代碼示例。如果您正苦於以下問題:Python pytorch_utils.SharedMLP方法的具體用法?Python pytorch_utils.SharedMLP怎麽用?Python pytorch_utils.SharedMLP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pytorch_utils的用法示例。


在下文中一共展示了pytorch_utils.SharedMLP方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import pytorch_utils [as 別名]
# 或者: from pytorch_utils import SharedMLP [as 別名]
def __init__(
            self,
            *,
            npoint: int,
            radii: List[float],
            nsamples: List[int],
            mlps: List[List[int]],
            bn: bool = True,
            use_xyz: bool = True, 
            sample_uniformly: bool = False
    ):
        super().__init__()

        assert len(radii) == len(nsamples) == len(mlps)

        self.npoint = npoint
        self.groupers = nn.ModuleList()
        self.mlps = nn.ModuleList()
        for i in range(len(radii)):
            radius = radii[i]
            nsample = nsamples[i]
            self.groupers.append(
                pointnet2_utils.QueryAndGroup(radius, nsample, use_xyz=use_xyz, sample_uniformly=sample_uniformly)
                if npoint is not None else pointnet2_utils.GroupAll(use_xyz)
            )
            mlp_spec = mlps[i]
            if use_xyz:
                mlp_spec[0] += 3

            self.mlps.append(pt_utils.SharedMLP(mlp_spec, bn=bn)) 
開發者ID:zaiweizhang,項目名稱:H3DNet,代碼行數:32,代碼來源:pointnet2_modules.py

示例2: __init__

# 需要導入模塊: import pytorch_utils [as 別名]
# 或者: from pytorch_utils import SharedMLP [as 別名]
def __init__(self, *, npoint: int, radii: List[float], nsamples: List[int], mlps: List[List[int]], bn: bool = True,
                 use_xyz: bool = True, pool_method='max_pool', instance_norm=False):
        """
        :param npoint: int
        :param radii: list of float, list of radii to group with
        :param nsamples: list of int, number of samples in each ball query
        :param mlps: list of list of int, spec of the pointnet before the global pooling for each scale
        :param bn: whether to use batchnorm
        :param use_xyz:
        :param pool_method: max_pool / avg_pool
        :param instance_norm: whether to use instance_norm
        """
        super().__init__()

        assert len(radii) == len(nsamples) == len(mlps)

        self.npoint = npoint
        self.groupers = nn.ModuleList()
        self.mlps = nn.ModuleList()
        for i in range(len(radii)):
            radius = radii[i]
            nsample = nsamples[i]
            self.groupers.append(
                pointnet2_utils.QueryAndGroup(radius, nsample, use_xyz=use_xyz)
                if npoint is not None else pointnet2_utils.GroupAll(use_xyz)
            )
            mlp_spec = mlps[i]
            if use_xyz:
                mlp_spec[0] += 3

            self.mlps.append(pt_utils.SharedMLP(mlp_spec, bn=bn, instance_norm=instance_norm))
        self.pool_method = pool_method 
開發者ID:daveredrum,項目名稱:Pointnet2.ScanNet,代碼行數:34,代碼來源:pointnet2_modules.py

示例3: __init__

# 需要導入模塊: import pytorch_utils [as 別名]
# 或者: from pytorch_utils import SharedMLP [as 別名]
def __init__(self, *, mlp: List[int], bn: bool = True):
        super().__init__()
        self.mlp = pt_utils.SharedMLP(mlp, bn=bn) 
開發者ID:Yochengliu,項目名稱:Relation-Shape-CNN,代碼行數:5,代碼來源:pointnet2_modules.py

示例4: __init__

# 需要導入模塊: import pytorch_utils [as 別名]
# 或者: from pytorch_utils import SharedMLP [as 別名]
def __init__(
        self,
        *,
        npoint: int,
        radii: List[float],
        nsamples: List[int],
        mlps: List[List[int]],
        bn: bool = True,
        use_xyz: bool = True,
        sample_uniformly: bool = False
    ):
        super().__init__()

        assert len(radii) == len(nsamples) == len(mlps)

        self.npoint = npoint
        self.groupers = nn.ModuleList()
        self.mlps = nn.ModuleList()
        for i in range(len(radii)):
            radius = radii[i]
            nsample = nsamples[i]
            self.groupers.append(
                pointnet2_utils.QueryAndGroup(
                    radius, nsample, use_xyz=use_xyz, sample_uniformly=sample_uniformly
                )
                if npoint is not None
                else pointnet2_utils.GroupAll(use_xyz)
            )
            mlp_spec = mlps[i]
            if use_xyz:
                mlp_spec[0] += 3

            self.mlps.append(pt_utils.SharedMLP(mlp_spec, bn=bn)) 
開發者ID:poodarchu,項目名稱:Det3D,代碼行數:35,代碼來源:pointnet2_modules.py


注:本文中的pytorch_utils.SharedMLP方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。