Example #1
0
def test_fd_srnn_compile():
    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)

    f_loss, f_dloss = rnn._make_loss_functions()
    f_loss(rnn.parameters.data, X, Z)
    f_dloss(rnn.parameters.data, X, Z)
Example #2
0
def test_fd_srnn_compile():
    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)

    f_loss, f_dloss = rnn._make_loss_functions()
    f_loss(rnn.parameters.data, X, Z)
    f_dloss(rnn.parameters.data, X, Z)