簡體   English   中英

CNTK:如何定義UpSampling2D

[英]CNTK: How to define UpSampling2D

我想知道如何在CNTK中實現UpSampling2D。 我在API中找不到這樣的圖層。

UpSampling2D是池化圖層的相反操作,通過重復數據的行和列來擴展數據。 這里的keras / tensorflow API的UpSampling2D

通過查看tensorflow代碼 ,他們使用backend.resize_images操作,但我也無法在CNTK API中找到resize操作。

UpSampling2D

答案1(來自Frank)

在此輸入圖像描述

答案2(來自大衛)

在此輸入圖像描述

來自Quora的圖片:完全卷積網絡如何對粗略輸出進行上采樣?

它可以從重塑和拼接的基本操作組裝,例如

>>> x = Input((3, 480, 640))
>>> xr = reshape(x, (3, 480, 1, 640, 1))
>>> xr.shape
(3, 480, 1, 640, 1)
>>> xx = splice(xr, xr, axis=-1) # axis=-1 refers to the last axis
>>> xx.shape
(3, 480, 1, 640, 2)
>>> xy = splice(xx, xx, axis=-3) # axis=-3 refers to the middle axis
>>> xy.shape
(3, 480, 2, 640, 2)
>>> r = reshape(xy, (3, 480*2, 640*2))
>>> r.shape
(3, 960, 1280)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM