示例#1
0
文件: test_rnn.py 项目: makarl/breze
def test_fd_srnn_fit():
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    rnn = SupervisedFastDropoutRnn(2, [10],
                                   3,
                                   hidden_transfer='rectifier',
                                   max_iter=10)
    rnn.fit(X, Z)
示例#2
0
文件: test_rnn.py 项目: osdf/breze
def test_fd_srnn_fit():
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    X, Z = theano_floatx(X, Z)
    rnn = SupervisedFastDropoutRnn(2, [10], 3, hidden_transfers=['rectifier'], max_iter=10)
    rnn.fit(X, Z)

    rnn = SupervisedFastDropoutRnn(
        2, [10, 20], 3, hidden_transfers=['rectifier', 'tanh'],
        skip_to_out=True, max_iter=10)
    rnn.fit(X, Z)
示例#3
0
文件: test_rnn.py 项目: Wiebke/breze
def test_fdsrnn_lstm_fit():
    X = np.random.standard_normal((13, 5, 4)).astype(theano.config.floatX)
    Z = np.random.standard_normal((13, 5, 3)).astype(theano.config.floatX)
    W = np.random.standard_normal((13, 5, 3)).astype(theano.config.floatX)

    X, Z, W = theano_floatx(X, Z, W)

    rnn = SupervisedFastDropoutRnn(4, [10], 3, hidden_transfers=['lstm'],
                                   max_iter=2)
    rnn.mode = 'FAST_COMPILE'
    rnn.fit(X, Z)
示例#4
0
文件: test_rnn.py 项目: Wiebke/breze
def test_fdrnn_pickle():
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    W = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    X, Z, W = theano_floatx(X, Z, W)

    rnn = SupervisedFastDropoutRnn(2, [10], 3, hidden_transfers=['rectifier'],
                                   max_iter=2)
    rnn.fit(X, Z)
    rnn.predict(X)

    pickle.dumps(rnn)
示例#5
0
def test_fdsrnn_lstm_fit():
    X = np.random.standard_normal((13, 5, 4)).astype(theano.config.floatX)
    Z = np.random.standard_normal((13, 5, 3)).astype(theano.config.floatX)
    W = np.random.standard_normal((13, 5, 3)).astype(theano.config.floatX)

    X, Z, W = theano_floatx(X, Z, W)

    rnn = SupervisedFastDropoutRnn(4, [10],
                                   3,
                                   hidden_transfers=['lstm'],
                                   max_iter=2)
    rnn.mode = 'FAST_COMPILE'
    rnn.fit(X, Z)
示例#6
0
def test_fdrnn_pickle():
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    W = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    X, Z, W = theano_floatx(X, Z, W)

    rnn = SupervisedFastDropoutRnn(2, [10],
                                   3,
                                   hidden_transfers=['rectifier'],
                                   max_iter=2)
    rnn.fit(X, Z)
    rnn.predict(X)

    pickle.dumps(rnn)
示例#7
0
def test_fd_srnn_fit():
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    X, Z = theano_floatx(X, Z)
    rnn = SupervisedFastDropoutRnn(2, [10],
                                   3,
                                   hidden_transfers=['rectifier'],
                                   max_iter=10)
    rnn.fit(X, Z)

    rnn = SupervisedFastDropoutRnn(2, [10, 20],
                                   3,
                                   hidden_transfers=['rectifier', 'tanh'],
                                   skip_to_out=True,
                                   max_iter=10)
    rnn.fit(X, Z)
示例#8
0
def test_fd_srnn_fit():
    raise SkipTest()
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    W = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    X, Z, W = theano_floatx(X, Z, W)
    rnn = SupervisedFastDropoutRnn(2, [10], 3, hidden_transfers=["rectifier"], max_iter=10)
    rnn.fit(X, Z)

    rnn = SupervisedFastDropoutRnn(
        2, [10, 20], 3, hidden_transfers=["rectifier", "tanh"], skip_to_out=True, max_iter=10
    )
    rnn.fit(X, Z)

    rnn = SupervisedFastDropoutRnn(
        2, [10, 20], 3, hidden_transfers=["rectifier", "tanh"], skip_to_out=True, max_iter=10, imp_weight=True
    )
    rnn.fit(X, Z, W)
示例#9
0
文件: test_rnn.py 项目: ddofer/breze
def test_fd_srnn_fit():
    X = np.random.standard_normal((10, 5, 2)).astype(theano.config.floatX)
    Z = np.random.standard_normal((10, 5, 3)).astype(theano.config.floatX)
    rnn = SupervisedFastDropoutRnn(2, [10], 3, hidden_transfer='rectifier', max_iter=10)
    rnn.fit(X, Z)