本文整理汇总了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)
示例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)
示例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)
示例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
示例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))
示例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)
示例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)