Пример #1
0
    def test_block_autoregressive_shapes(self):
        for residual in [None, 'normal', 'gated']:
            for shape in [(3,), (3, 4), (3, 4, 2)]:
                input_dim = shape[-1]
                self._test_shape(shape, T.block_autoregressive(input_dim, residual=residual))

        for activation in ['ELU', 'LeakyReLU', 'sigmoid', 'tanh']:
            for shape in [(3,), (3, 4), (3, 4, 2)]:
                input_dim = shape[-1]
                self._test_shape(shape, T.block_autoregressive(input_dim, activation=activation))
Пример #2
0
    def test_block_autoregressive_jacobians(self):
        for activation in ['ELU', 'LeakyReLU', 'sigmoid', 'tanh']:
            for input_dim in [2, 5, 10]:
                self._test_jacobian(
                    input_dim,
                    T.block_autoregressive(input_dim, activation=activation))

        for residual in [None, 'normal', 'gated']:
            for input_dim in [2, 5, 10]:
                self._test_jacobian(
                    input_dim,
                    T.block_autoregressive(input_dim, residual=residual))