我是靠谱客的博主 饱满店员,这篇文章主要介绍Pytorch上下采样函数--interpolate用法,现在分享给大家,希望可以做个参考。

def interpolate(input, size=None, scale_factor=None, mode='nearest', align_corners=None):

  根据给定 size 或 scale_factor,上采样或下采样输入数据input.

  当前支持 temporal, spatial 和 volumetric 输入数据的上采样,其shape 分别为:3-D, 4-D 和 5-D.

  输入数据的形式为:mini-batch x channels x [optional depth] x [optional height] x width.

  上采样算法有:nearest, linear(3D-only), bilinear(4D-only), trilinear(5D-only).  

  参数:

  - input (Tensor): input tensor

  - size (int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int]):输出的 spatial 尺寸.

  - scale_factor (float or Tuple[float]): spatial 尺寸的缩放因子.

  - mode (string): 上采样算法:nearest, linear, bilinear, trilinear, area. 默认为 nearest.

  - align_corners (bool, optional): 如果 align_corners=True,则对齐 input 和 output 的角点像素(corner pixels),保持在角点像素的值. 只会对 mode=linear, bilinear 和 trilinear 有作用. 默认是 False.

  """

最后

以上就是饱满店员最近收集整理的关于Pytorch上下采样函数--interpolate用法的全部内容,更多相关Pytorch上下采样函数--interpolate用法内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部