Exemple #1
0
def create_convolution(size, depth, winlen):
    conv_actfun = activation.tanh
    return layers.Serial(
        [layers.Convolution(3, size, winlen, stride=1, fun=conv_actfun)] +
        [layers.Residual(layers.Convolution(size, size, winlen, stride=1, fun=conv_actfun)) for _ in range(depth)] +
        [layers.Convolution(size, 3, winlen, stride=1, fun=activation.linear)]
    )
Exemple #2
0
 def setUp(self):
     sublayer = nn.FeedForward(12, 12, has_bias=True)
     self.layer = nn.Residual(sublayer)