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


Python links.ConvolutionND方法代碼示例

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


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

示例1: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self, traj_dim_in):
        chan_traj_c0_c1 = 16
        chan_traj_c1_d0 = 32
        units_traj_d0_d1 = 32
        units_traj_d1_d2 = 16

        # This means, 1 input dimension (so we convolve along the temporal axis) and treat
        # each feature dimension as a channel. The temporal axis is always the same length
        # since this is fixed with a buffer that keeps track of the latest data.
        traj_c0 = L.ConvolutionND(
            ndim=1, in_channels=traj_dim_in, out_channels=chan_traj_c0_c1, ksize=6, stride=5)
        traj_c1 = L.ConvolutionND(
            ndim=1, in_channels=chan_traj_c0_c1, out_channels=chan_traj_c1_d0, ksize=4, stride=2)
        traj_d0 = L.Linear(in_size=chan_traj_c1_d0, out_size=units_traj_d0_d1)
        loss_d0 = L.Linear(in_size=traj_dim_in + units_traj_d0_d1, out_size=units_traj_d1_d2)
        loss_d1 = L.Linear(in_size=units_traj_d1_d2, out_size=1)

        Loss.__init__(self,
                      # trajectory processing
                      traj_c0=traj_c0, traj_c1=traj_c1, traj_d0=traj_d0,
                      # loss processing
                      loss_d0=loss_d0, loss_d1=loss_d1) 
開發者ID:openai,項目名稱:EPG,代碼行數:24,代碼來源:losses.py

示例2: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self, ndim, nobias):
        super(ConvND, self).__init__()
        with self.init_scope():
            self.l1 = L.ConvolutionND(ndim, 7, 10, 3,
                                      stride=1, pad=1, nobias=nobias) 
開發者ID:pfnet-research,項目名稱:chainer-compiler,代碼行數:7,代碼來源:ConvolutionND.py

示例3: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self, nb_in, nb_out, ksize=1, pad=0, no_bn=False):
        super(Conv_BN, self).__init__()
        self.no_bn = no_bn
        with self.init_scope():
            self.conv = L.ConvolutionND(1, nb_in, nb_out, ksize=ksize, pad=pad)
            if not no_bn:
                self.bn = L.BatchNormalization(nb_out) 
開發者ID:takumayagi,項目名稱:fpl,代碼行數:9,代碼來源:module.py

示例4: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self, vocab, vocab_ngram_tokens, n_units, n_units_char,
                 dropout, subword):  # dropout ratio, zero indicates no dropout
        super(CNN1D, self).__init__()
        with self.init_scope():
            self.subword = subword
            # n_units_char = 15
            self.embed = L.EmbedID(
                len(vocab_ngram_tokens.lst_words) + 2, n_units_char,
                initialW=I.Uniform(1. / n_units_char))  # ngram tokens embedding  plus 2 for OOV and end symbol.

            self.n_ngram = vocab_ngram_tokens.metadata["max_gram"] - vocab_ngram_tokens.metadata["min_gram"] + 1

            # n_filters = {i: min(200, i * 5) for i in range(1, 1 + 1)}
            # self.cnns = (L.Convolution2D(1, v, (k, n_units_char),) for k, v in n_filters.items())
            # self.out = L.Linear(sum([v for k, v in n_filters.items()]), n_units)
            if 'small' in self.subword:
                self.cnn1 = L.ConvolutionND(1, n_units_char, 50, (1,), )
                self.out = L.Linear(50, n_units)
            else:
                self.cnn1 = L.ConvolutionND(1, n_units_char, 50, (1,), )
                self.cnn2 = L.ConvolutionND(1, n_units_char, 100, (2,), )
                self.cnn3 = L.ConvolutionND(1, n_units_char, 150, (3,), )
                self.cnn4 = L.ConvolutionND(1, n_units_char, 200, (4,), )
                self.cnn5 = L.ConvolutionND(1, n_units_char, 200, (5,), )
                self.cnn6 = L.ConvolutionND(1, n_units_char, 200, (6,), )
                self.cnn7 = L.ConvolutionND(1, n_units_char, 200, (7,), )
                self.out = L.Linear(1100, n_units)

            self.dropout = dropout
            self.vocab = vocab
            self.vocab_ngram_tokens = vocab_ngram_tokens 
開發者ID:vecto-ai,項目名稱:vecto,代碼行數:33,代碼來源:subword.py

示例5: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self, out_ch=128):
        super(FeatureVoxelNet, self).__init__(
            conv1 = L.ConvolutionND(1, 7, 16, 1, nobias=True),
            conv2 = L.ConvolutionND(1, 32, 64, 1, nobias=True),
            conv3 = L.ConvolutionND(1, 128, out_ch, 1),
            bn1 = BN(16), #L.BatchNormalization(16),
            bn2 = BN(64)) #L.BatchNormalization(64),
            #bn3 = BN(out_ch)) #L.BatchNormalization(out_ch)) 
開發者ID:yukitsuji,項目名稱:voxelnet_chainer,代碼行數:10,代碼來源:light_voxelnet.py

示例6: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self):
        initW = chainer.initializers.HeNormal(scale=0.01)
        super().__init__()

        with self.init_scope():
            self.bnorm1 = L.BatchNormalization(size=64)
            self.conv1 = L.ConvolutionND(3, 64, 64, 3, pad=1, initialW=initW)
            self.bnorm2 = L.BatchNormalization(size=64)
            self.conv2 = L.ConvolutionND(3, 64, 64, 3, pad=1, initialW=initW) 
開發者ID:Ryo-Ito,項目名稱:brain_segmentation,代碼行數:11,代碼來源:model.py

示例7: __init__

# 需要導入模塊: from chainer import links [as 別名]
# 或者: from chainer.links import ConvolutionND [as 別名]
def __init__(self, in_channels, top_width, mid_ch, wscale=0.01):
        super(VideoDiscriminatorInitUniform, self).__init__()
        w = chainer.initializers.Uniform(wscale)
        with self.init_scope():
            self.c0 = L.ConvolutionND(3, in_channels, mid_ch, 4, 2, 1, initialW=w)
            self.c1 = L.ConvolutionND(3, mid_ch, mid_ch * 2, 4, 2, 1, initialW=w)
            self.c2 = L.ConvolutionND(3, mid_ch * 2, mid_ch * 4, 4, 2, 1, initialW=w)
            self.c3 = L.ConvolutionND(3, mid_ch * 4, mid_ch * 8, 4, 2, 1, initialW=w)
            self.c4 = L.Convolution2D(mid_ch * 8, 1, top_width, 1, 0, initialW=w)
            self.bn0 = L.BatchNormalization(mid_ch)
            self.bn1 = L.BatchNormalization(mid_ch * 2)
            self.bn2 = L.BatchNormalization(mid_ch * 4)
            self.bn3 = L.BatchNormalization(mid_ch * 8) 
開發者ID:pfnet-research,項目名稱:tgan,代碼行數:15,代碼來源:video_discriminator.py


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