Hi,

I'm new on this list, so I hope I'm not duplicating a subject that has 
already been covered and answered.

I'm trying to implement High-Order RNN (https://arxiv.org/abs/1605.00064) 
and I would like to let me chose the order arbitrarily, which changes the 
number parameters to pass to the inner scan function.
For this purpose, I'm doing something like:

    def step(in_t, *args):

        W_xi_ = args[-2]
        b_i_ = args[-1]
        args = args[:-2]

        h_t = T.dot(in_t, W_xi_)

        for p in xrange(order):
            h_t += T.dot(args[p], args[order+p])

        h_t = nonlinearity(h_t + b_i_)

        return h_t

    h, _ = theano.scan(step, sequences=[invalues],
            outputs_info=[dict(initial=hid_init, taps=range(-order,0))],
            non_sequences=W_hip+[W_xi, b_i], strict=True)

W_hip being a list of shared matrices, one for each tap.

Basically, it compiles, I can train such a model, so it looks like it works.

However, I've strictly no clue if the code is doing what I'm expecting it 
to do.
Is is okay to use a for loop in th inner scan function?
Does scan behave nicely with a variable number of argument?

Any tips to help verifying/checking that a code is doing what it is 
supposed to do is also very welcome.

Cheers,


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to