pytorch torch.nn 实现上采样——nn.Upsample - 慢行厚积 - 博客园
仅仅作为自己的笔记,有需要的话直接看原文吧。
CLASS torch.nn.Upsample(size=None, scale_factor=None, mode='nearest', align_corners=None)
参数:
size (int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int], optional) – 根据不同的输入类型制定的输出大小
scale_factor (float or Tuple[float] or Tuple[float, float] or Tuple[float, float, float], optional) – 指定输出为输入的多少倍数。如果输入为tuple,其也要制定为tuple类型
mode (str, optional) – 可使用的上采样算法,有'nearest', 'linear', 'bilinear', 'bicubic' and 'trilinear'. 默认使用'nearest'
align_corners (bool, optional) – 如果为True,输入的角像素将与输出张量对齐,因此将保存下来这些像素的值。仅当使用的算法为'linear', 'bilinear'or 'trilinear'时可以使用。默认设置为False