當前位置: 首頁>>代碼示例>>Python>>正文


Python links.DeconvolutionND方法代碼示例

本文整理匯總了Python中chainer.links.DeconvolutionND方法的典型用法代碼示例。如果您正苦於以下問題:Python links.DeconvolutionND方法的具體用法?Python links.DeconvolutionND怎麽用?Python links.DeconvolutionND使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在chainer.links的用法示例。


在下文中一共展示了links.DeconvolutionND方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import DeconvolutionND [as 別名]
def __init__(self, nb_inputs, channel_list, ksize_list, no_act_last=False):
        super(Decoder, self).__init__()
        self.nb_layers = len(channel_list)
        self.no_act_last = no_act_last
        channel_list = channel_list + [nb_inputs]
        for idx, (nb_in, nb_out, ksize) in enumerate(zip(channel_list[:-1], channel_list[1:], ksize_list[::-1])):
            self.add_link("deconv{}".format(idx), L.DeconvolutionND(1, nb_in, nb_out, ksize))
            if no_act_last and idx == self.nb_layers - 1:
                continue
            self.add_link("bn{}".format(idx), L.BatchNormalization(nb_out)) 
開發者ID:takumayagi,項目名稱:fpl,代碼行數:12,代碼來源:module.py

示例2: added

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import DeconvolutionND [as 別名]
def added(self, link):
        # Define axis and register ``u`` if the weight is initialized.
        if not hasattr(link, self.weight_name):
            raise ValueError(
                'Weight \'{}\' does not exist!'.format(self.weight_name))
        if isinstance(link, (L.Deconvolution2D, L.DeconvolutionND)):
            self.axis = 1
        if getattr(link, self.weight_name).array is not None:
            self._prepare_parameters(link) 
開發者ID:chainer,項目名稱:chainer,代碼行數:11,代碼來源:spectral_normalization.py

示例3: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import DeconvolutionND [as 別名]
def __init__(self, in_channels=1, n_classes=4):
        init = chainer.initializers.HeNormal(scale=0.01)
        super().__init__()

        with self.init_scope():
            self.conv1a = L.ConvolutionND(
                3, in_channels, 32, 3, pad=1, initialW=init)
            self.bnorm1a = L.BatchNormalization(32)
            self.conv1b = L.ConvolutionND(
                3, 32, 32, 3, pad=1, initialW=init)
            self.bnorm1b = L.BatchNormalization(32)
            self.conv1c = L.ConvolutionND(
                3, 32, 64, 3, stride=2, pad=1, initialW=init)
            self.voxres2 = VoxResModule()
            self.voxres3 = VoxResModule()
            self.bnorm3 = L.BatchNormalization(64)
            self.conv4 = L.ConvolutionND(
                3, 64, 64, 3, stride=2, pad=1, initialW=init)
            self.voxres5 = VoxResModule()
            self.voxres6 = VoxResModule()
            self.bnorm6 = L.BatchNormalization(64)
            self.conv7 = L.ConvolutionND(
                3, 64, 64, 3, stride=2, pad=1, initialW=init)
            self.voxres8 = VoxResModule()
            self.voxres9 = VoxResModule()
            self.c1deconv = L.DeconvolutionND(
                3, 32, 32, 3, pad=1, initialW=init)
            self.c1conv = L.ConvolutionND(
                3, 32, n_classes, 3, pad=1, initialW=init)
            self.c2deconv = L.DeconvolutionND(
                3, 64, 64, 4, stride=2, pad=1, initialW=init)
            self.c2conv = L.ConvolutionND(
                3, 64, n_classes, 3, pad=1, initialW=init)
            self.c3deconv = L.DeconvolutionND(
                3, 64, 64, 6, stride=4, pad=1, initialW=init)
            self.c3conv = L.ConvolutionND(
                3, 64, n_classes, 3, pad=1, initialW=init)
            self.c4deconv = L.DeconvolutionND(
                3, 64, 64, 10, stride=8, pad=1, initialW=init)
            self.c4conv = L.ConvolutionND(
                3, 64, n_classes, 3, pad=1, initialW=init) 
開發者ID:Ryo-Ito,項目名稱:brain_segmentation,代碼行數:43,代碼來源:model.py

示例4: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import DeconvolutionND [as 別名]
def __init__(self, n_frames=16, z_slow_dim=256, z_fast_dim=256, wscale=0.01):
        super(FrameSeedGeneratorInitUniform, self).__init__()
        w = chainer.initializers.Uniform(wscale)
        with self.init_scope():
            self.dc0 = L.DeconvolutionND(1, z_slow_dim, 512, 1, 1, 0, initialW=w)
            self.dc1 = L.DeconvolutionND(1, 512, 256, 4, 2, 1, initialW=w)
            self.dc2 = L.DeconvolutionND(1, 256, 128, 4, 2, 1, initialW=w)
            self.dc3 = L.DeconvolutionND(1, 128, 128, 4, 2, 1, initialW=w)
            self.dc4 = L.DeconvolutionND(1, 128, z_fast_dim, 4, 2, 1, initialW=w)
            self.bn0 = L.BatchNormalization(512)
            self.bn1 = L.BatchNormalization(256)
            self.bn2 = L.BatchNormalization(128)
            self.bn3 = L.BatchNormalization(128)
        self.z_slow_dim = z_slow_dim
        self.z_fast_dim = z_fast_dim 
開發者ID:pfnet-research,項目名稱:tgan,代碼行數:17,代碼來源:frame_seed_generator.py


注:本文中的chainer.links.DeconvolutionND方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。