MinkowskiPooling池化(上)

如果内核大小等于跨步大小(例如kernel_size = [21],跨步= [21]),则引擎将更快地生成与池化函数相对应的输入输出映射。

如果使用U网络架构,请使用相同功能的转置版本进行上采样。例如pool = MinkowskiSumPoolingkernel_size = 2stride = 2D = D,然后使用 unpool = MinkowskiPoolingTransposekernel_size = 2stride = 2D = D

stride (int, or list, optional):卷积层的步幅大小。如果使用非同一性,则输出坐标至少为stride ×× tensor_stride 远。给出列表时,长度必须为D;每个元素将用于特定轴的步幅大小。

dilation (int, or list, optional):卷积内核的扩展大小。给出列表时,长度必须为D,并且每个元素都是轴特定的膨胀。所有元素必须> 0。

kernel_generator (MinkowskiEngine.KernelGenerator, optional):定义自定义内核形状。

dimension(int):定义所有输入和网络的空间的空间尺寸。例如,图像在2D空间中,网格和3D形状在3D空间中。

当kernel_size ==跨度时,不支持自定义内核形状。

cpu() → T

将所有模型参数和缓冲区移至CPU。

Returns:

Module: self

cuda(device: Optional[Union[int, torch.device]] = None) → T

将所有模型参数和缓冲区移至GPU。

这也使关联的参数并缓冲不同的对象。因此,在构建优化程序之前,如果模块在优化过程中可以在GPU上运行,则应调用它。

Arguments:

device (int, optional): if specified, all parameters will be

copied to that device

Returns:

Module: self

double() → T

将所有浮点参数和缓冲区强制转换为double数据类型。

返回值:

模块:self

float() →T

将所有浮点参数和缓冲区强制转换为float数据类型。

返回值:

模块:self

forward(input: SparseTensor.SparseTensor, coords: Union[torch.IntTensor, MinkowskiCoords.CoordsKey, SparseTensor.SparseTensor] = None)

input (MinkowskiEngine.SparseTensor):输入稀疏张量以对其进行卷积。

coords ((torch.IntTensor, MinkowskiEngine.CoordsKey, MinkowskiEngine.SparseTensor), optional):如果提供,则在提供的坐标上生成结果。默认情况下没有。

to(*args, **kwargs)

Moves and/or casts the parameters and buffers.

This can be called as

to(device=None, dtype=None, non_blocking=False)

to(dtype, non_blocking=False)

to(tensor, non_blocking=False)

to(memory_format=torch.channels_last)

其签名类似于torch.Tensor.to(),但仅接受所需dtype的浮点s。另外,此方法将仅将浮点参数和缓冲区强制转换为dtype (如果给定的话)。device如果给定了整数参数和缓冲区 ,dtype不变。当 non_blocking被设置时,它试图转换/如果可能异步相对于移动到主机,例如,移动CPU张量与固定内存到CUDA设备。

此方法local修改模块。

Args:

device (torch.device): the desired device of the parameters

and buffers in this module

dtype (torch.dtype): the desired floating point type of

the floating point parameters and buffers in this module

tensor (torch.Tensor): Tensor whose dtype and device are the desired

dtype and device for all parameters and buffers in this module

memory_format (torch.memory_format): the desired memory

format for 4D parameters and buffers in this module (keyword only argument)

Returns:

Module: self

Example:

>>> linear = nn.Linear(2, 2)

>>> linear.weight

Parameter containing:

tensor([[ 0.1913, -0.3420],

[-0.5113, -0.2325]])

>>> linear.to(torch.double)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1913, -0.3420],

[-0.5113, -0.2325]], dtype=torch.float64)

>>> gpu1 = torch.device("cuda:1")

>>> linear.to(gpu1, dtype=torch.half, non_blocking=True)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1914, -0.3420],

[-0.5112, -0.2324]], dtype=torch.float16, device='cuda:1')

>>> cpu = torch.device("cpu")

>>> linear.to(cpu)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1914, -0.3420],

[-0.5112, -0.2324]], dtype=torch.float16)

type(dst_type: Union[torch.dtype, str]) → T

Casts all parameters and buffers to dst_type.

Arguments:

dst_type (type or string): the desired type

Returns:

Module: self

MinkowskiAvgPooling

平均层首先计算输入要素的基数,每个输出的输入要素数,然后将输入要素的总和除以基数。对于密集的张量,基数是一个常数,即内核的体积。但是,对于张量稀疏,基数取决于每个输出的输入特征的数量而变化。因此,稀疏张量的平均池化不等于传统的密集张量的平均池化层。请参考MinkowskiSumPooling等效层。

如果内核大小等于跨步大小(例如kernel_size = [21],跨步= [21]),则引擎将更快地生成与池化函数相对应的输入输出映射。

如果使用U网络架构,请使用相同功能的转置版本进行上采样。例如pool = MinkowskiSumPoolingkernel_size = 2stride = 2D = D,然后使用 unpool = MinkowskiPoolingTransposekernel_size = 2stride = 2D = D

__init__(kernel_size=- 1, stride=1, dilation=1, kernel_generator=None, dimension=None)

高维稀疏平均池化层。

kernel_size (int, optional): the size of the kernel in the output tensor. If not provided, region_offset should be RegionType.CUSTOM and region_offset should be a 2D matrix with size N×DN×D such that it lists all NN offsets in D-dimension.

stride (int, or list, optional): stride size of the convolution layer. If non-identity is used, the output coordinates will be at least stride ×× tensor_stride away. When a list is given, the length must be D; each element will be used for stride size for the specific axis.

dilation (int, or list, optional): dilation size for the convolution kernel. When a list is given, the length must be D and each element is an axis specific dilation. All elements must be > 0.

kernel_generator (MinkowskiEngine.KernelGenerator, optional): define custom kernel shape.

dimension (int): the spatial dimension of the space where all the inputs and the network are defined. For example, images are in a 2D space, meshes and 3D shapes are in a 3D space.

当kernel_size ==跨度时,不支持自定义内核形状。

cpu() →T

将所有模型参数和缓冲区移至CPU。

返回值:

模块:self

cuda(device: Optional[Union[int, torch.device]] = None) → T

所有模型参数和缓冲区移至GPU。

这也使关联的参数并缓冲不同的对象。因此,在构建优化程序之前,如果模块在优化过程中可以在GPU上运行,则应调用它。

Arguments:

device (int, optional): if specified, all parameters will be

copied to that device

Returns:

Module: self

double() → T

将所有浮点参数和缓冲区强制转换为double数据类型。

返回值:

模块:self

float() →T

将所有浮点参数和缓冲区强制转换为float数据类型。

返回值:

模块:self

forward(input: SparseTensor.SparseTensor, coords: Union[torch.IntTensor, MinkowskiCoords.CoordsKey, SparseTensor.SparseTensor] = None)

input (MinkowskiEngine.SparseTensor): Input sparse tensor to apply a convolution on.

coords ((torch.IntTensor, MinkowskiEngine.CoordsKey, MinkowskiEngine.SparseTensor), optional): If provided, generate results on the provided coordinates. None by default.

to(*args, **kwargs)

Moves and/or casts the parameters and buffers.

This can be called as

to(device=None, dtype=None, non_blocking=False)

to(dtype, non_blocking=False)

to(tensor, non_blocking=False)

to(memory_format=torch.channels_last)

其签名类似于torch.Tensor.to(),但仅接受所需dtype的浮点s。另外,此方法将仅将浮点参数和缓冲区强制转换为dtype (如果给定的话)。device如果给定了整数参数和缓冲区 ,dtype不变。当 non_blocking被设置时,它试图转换/如果可能异步相对于移动到主机,例如,移动CPU张量与固定内存到CUDA设备。

This method modifies the module in-place.

Args:

device (torch.device): the desired device of the parameters

and buffers in this module

dtype (torch.dtype): the desired floating point type of

the floating point parameters and buffers in this module

tensor (torch.Tensor): Tensor whose dtype and device are the desired

dtype and device for all parameters and buffers in this module

memory_format (torch.memory_format): the desired memory

format for 4D parameters and buffers in this module (keyword only argument)

Returns:

Module: self

Example:

>>> linear = nn.Linear(2, 2)

>>> linear.weight

Parameter containing:

tensor([[ 0.1913, -0.3420],

[-0.5113, -0.2325]])

>>> linear.to(torch.double)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1913, -0.3420],

[-0.5113, -0.2325]], dtype=torch.float64)

>>> gpu1 = torch.device("cuda:1")

>>> linear.to(gpu1, dtype=torch.half, non_blocking=True)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1914, -0.3420],

[-0.5112, -0.2324]], dtype=torch.float16, device='cuda:1')

>>> cpu = torch.device("cpu")

>>> linear.to(cpu)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1914, -0.3420],

[-0.5112, -0.2324]], dtype=torch.float16)

type(dst_type: Union[torch.dtype, str]) → T

Casts all parameters and buffers to dst_type.

Arguments:

dst_type (type or string): the desired type

Returns:

Module: self

MinkowskiSumPooling

class MinkowskiEngine.MinkowskiSumPooling(kernel_size, stride=1, dilation=1, kernel_generator=None, dimension=None)

Sum all input features within a kernel.

平均层首先计算输入要素的基数,每个输出的输入要素数,然后将输入要素的总和除以基数。对于密集的张量,基数是一个常数,即内核的体积。但是,对于张量稀疏,基数根据每个输出的输入特征数而变化。因此,用基数对输入特征求平均可能不等于密集张量的常规平均池。该层提供了一种不将总和除以基数的方法。

如果内核大小等于跨步大小(例如kernel_size = [21],跨步= [21]),则引擎将更快地生成与池化函数相对应的输入输出映射。

如果使用U网络架构,请使用相同功能的转置版本进行上采样。例如pool = MinkowskiSumPoolingkernel_size = 2stride = 2D = D,然后使用 unpool = MinkowskiPoolingTransposekernel_size = 2stride = 2D = D

__init__(kernel_size, stride=1, dilation=1, kernel_generator=None, dimension=None)

a high-dimensional sum pooling layer

Args:

kernel_size (int, optional): the size of the kernel in the output tensor. If not provided, region_offset should be RegionType.CUSTOM and region_offset should be a 2D matrix with size N×DN×D such that it lists all NN offsets in D-dimension.

stride (int, or list, optional): stride size of the convolution layer. If non-identity is used, the output coordinates will be at least stride ×× tensor_stride away. When a list is given, the length must be D; each element will be used for stride size for the specific axis.

dilation (int, or list, optional): dilation size for the convolution kernel. When a list is given, the length must be D and each element is an axis specific dilation. All elements must be > 0.

kernel_generator (MinkowskiEngine.KernelGenerator, optional): define custom kernel shape.

dimension (int): the spatial dimension of the space where all the inputs and the network are defined. For example, images are in a 2D space, meshes and 3D shapes are in a 3D space.

当kernel_size ==跨度时,不支持自定义内核形状。

cpu() →T

将所有模型参数和缓冲区移至CPU。

返回值:

模块:self

cuda(device:Optional[Union[int, torch.device]]=None) → T

将所有模型参数和缓冲区移至GPU。

这也使关联的参数并缓冲不同的对象。因此,在构建优化程序之前,如果模块在优化过程中可以在GPU上运行,则应调用它。

参数:

device (int, optional): if specified, all parameters will be

copied to that device

Returns:

Module: self

double() → T

将所有浮点参数和缓冲区强制转换为double数据类型。

返回值:

模块:self

float() →T

将所有浮点参数和缓冲区强制转换为float数据类型。

返回值:

模块:self

forward(input: SparseTensor.SparseTensor, coords: Union[torch.IntTensor, MinkowskiCoords.CoordsKey, SparseTensor.SparseTensor] = None)

input (MinkowskiEngine.SparseTensor): Input sparse tensor to apply a convolution on.

coords ((torch.IntTensor, MinkowskiEngine.CoordsKey, MinkowskiEngine.SparseTensor), optional): If provided, generate results on the provided coordinates. None by default.

to(*args, **kwargs)

Moves and/or casts the parameters and buffers.

This can be called as

to(device=None, dtype=None, non_blocking=False)

to(dtype, non_blocking=False)

to(tensor, non_blocking=False)

to(memory_format=torch.channels_last)

其签名类似于torch.Tensor.to(),但仅接受所需dtype的浮点s。另外,此方法将仅将浮点参数和缓冲区强制转换为dtype (如果给定的话)。device如果给定了整数参数和缓冲区 ,dtype不变。当 non_blocking被设置时,它试图转换/如果可能异步相对于移动到主机,例如,移动CPU张量与固定内存到CUDA设备。

请参见下面的示例。

Args:

device (torch.device): the desired device of the parameters

and buffers in this module

dtype (torch.dtype): the desired floating point type of

the floating point parameters and buffers in this module

tensor (torch.Tensor): Tensor whose dtype and device are the desired

dtype and device for all parameters and buffers in this module

memory_format (torch.memory_format): the desired memory

format for 4D parameters and buffers in this module (keyword only argument)

Returns:

Module: self

Example:

>>> linear = nn.Linear(2, 2)

>>> linear.weight

Parameter containing:

tensor([[ 0.1913, -0.3420],

[-0.5113, -0.2325]])

>>> linear.to(torch.double)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1913, -0.3420],

[-0.5113, -0.2325]], dtype=torch.float64)

>>> gpu1 = torch.device("cuda:1")

>>> linear.to(gpu1, dtype=torch.half, non_blocking=True)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1914, -0.3420],

[-0.5112, -0.2324]], dtype=torch.float16, device='cuda:1')

>>> cpu = torch.device("cpu")

>>> linear.to(cpu)

Linear(in_features=2, out_features=2, bias=True)

>>> linear.weight

Parameter containing:

tensor([[ 0.1914, -0.3420],

[-0.5112, -0.2324]], dtype=torch.float16)

type(dst_type: Union[torch.dtype, str]) → T

Casts all parameters and buffers to dst_type.

Arguments:

dst_type (type or string): the desired type

Returns:

Module: self

MinkowskiPooling池化(上)的更多相关文章

  1. MinkowskiPooling池化(下)

    MinkowskiPooling池化(下) MinkowskiPoolingTranspose class MinkowskiEngine.MinkowskiPoolingTranspose(kern ...

  2. 对象池化技术 org.apache.commons.pool

    恰当地使用对象池化技术,可以有效地减少对象生成和初始化时的消耗,提高系统的运行效率.Jakarta Commons Pool组件提供了一整套用于实现对象池化的框架,以及若干种各具特色的对象池实现,可以 ...

  3. CVPR 2019|PoolNet:基于池化技术的显著性检测 论文解读

    作者 | 文永亮 研究方向 | 目标检测.GAN 研究动机 ​ 这是一篇发表于CVPR2019的关于显著性目标检测的paper,在U型结构的特征网络中,高层富含语义特征捕获的位置信息在自底向上的传播过 ...

  4. 卷积和池化的区别、图像的上采样(upsampling)与下采样(subsampled)

    1.卷积 当从一个大尺寸图像中随机选取一小块,比如说 8x8 作为样本,并且从这个小块样本中学习到了一些特征,这时我们可以把从这个 8x8 样本中学习到的特征作为探测器,应用到这个图像的任意地方中去. ...

  5. 测试EntityFramework,Z.EntityFramework.Extensions,原生语句在不同的查询中的表现。原来池化与非池化设定是有巨大的影响的。

    Insert测试,只测试1000条的情况,多了在实际的项目中应该就要另行处理了. using System; using System.Collections.Generic; using Syste ...

  6. 由浅入深了解Thrift之客户端连接池化

    一.问题描述 在上一篇<由浅入深了解Thrift之服务模型和序列化机制>文章中,我们已经了解了thrift的基本架构和网络服务模型的优缺点.如今的互联网圈中,RPC服务化的思想如火如荼.我 ...

  7. Deep Learning 学习随记(七)Convolution and Pooling --卷积和池化

    图像大小与参数个数: 前面几章都是针对小图像块处理的,这一章则是针对大图像进行处理的.两者在这的区别还是很明显的,小图像(如8*8,MINIST的28*28)可以采用全连接的方式(即输入层和隐含层直接 ...

  8. 高可用的池化 Thrift Client 实现(源码分享)

    本文将分享一个高可用的池化 Thrift Client 及其源码实现,欢迎阅读源码(Github)并使用,同时欢迎提出宝贵的意见和建议,本人将持续完善. 本文的主要目标读者是对 Thrift 有一定了 ...

  9. tensorflow max_pool(最大池化)应用

    1.最大池化 max pooling是CNN当中的最大值池化操作,其实用法和卷积很类似. tf.nn.max_pool(value, ksize, strides, padding, name=Non ...

随机推荐

  1. js弹窗的3种方式:alert、confirm、prompt

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. ZOJ 3736 模拟魔方

    题意:       2*2*2的魔方,给你一个初始状态,和一个限定步数,问你在这么多步数条件下最多能有多少面拼好,(不是累加关系,是某一个状态的最多,最多是6); 思路:      最多是7步,所以直 ...

  3. 通过修改EIP寄存器实现强行跳转并且注入DLL到目标进程里

    /* 描述 功能:通过修改EIP寄存器实现32位程序的DLL注入(如果是64位,记得自己对应修改汇编代码部分) 原理: 挂起目标进程,停止目标进程EIP的变换,在目标进程开启空间,然后把相关的指令机器 ...

  4. 【python】Leetcode每日一题-搜索排序数组2

    [python]Leetcode每日一题-搜索排序数组2 [题目描述] 已知存在一个按非降序排列的整数数组 nums ,数组中的值不必互不相同. 在传递给函数之前,nums 在预先未知的某个下标 k( ...

  5. Vue中的MVVM

    MVVM(Model View VueModel) View层: 视图层 在我们前端开发中,通常就是DOM层 主要的作用就是给用户展示各种信息 Model层: 数据层 数据可能是我们固定的死数据,更多 ...

  6. C#如何加载嵌入到资源的非托管dll

    如何加载非托管Dll 我们总会遇到需要加载非Win32的非托管dll,这里推荐一种方式就是将那些非win32的非托管dll嵌入资源的方式,在入口解压并且加载的方式,我先来看看如何实现吧,首先我们准备好 ...

  7. mac 安装jmeter

    1.打开jemeter网址 http://jmeter.apache.org/download_jmeter.cgi 2.下载Binaries中的 apache-jmeter-5.0.tgz 3.解压 ...

  8. 关于文字内容过长,导致文本内容超出html 标签宽度的解决方法之自动换行

    在标签的style 属性中设置 word-break style="word-break:break-all;" 这样就可以实现换行 上截图没设置之前 设置之后 完美解决!!!!! ...

  9. markerdown基础

    标题 用#+空格 字体 加粗两边两个** 斜体两边* 斜体加粗三个* 引用 '>' 分割线 三个---或者三个*** 图片 ![截图]() 超链接 点击跳转到文章 []+() 列表 1 + 点+ ...

  10. ceph总结复习

    一.ceph概念 Ceph是一种为优秀的性能.可靠性和可扩展性而设计的统一的.分布式文件系统.ceph 的统一体现在可以提供文件系统.块存储和对象存储,分布式体现在可以动态扩展. 什么是块存储/对象存 ...