1、用法
from tensorflow.keras.layers import UpSampling2D
i3 = UpSampling2D(size=(2, 2), data_format=None, interpolation='nearest')(i3)
r3 = UpSampling2D(size=(3, 3), data_format=None, interpolation='bilinear')(r3)
2、参数介绍
参数 | 介绍 |
---|---|
size | 行与列的采样数。即上采样倍数 |
data_format | 数据的输入形状。默认"channels_last",还有"channels_first" ,前者输入的数据格式为(B, H, W, C),后者输输入的数据格式为(B, C, H, W) |
interpolation | 插值方式。“nearest"最近采样方式 或者"bilinear” 双直线采样方式,默认"nearest" |