WIP: BaseRecurrent and recurrent_apply_method

The scan related code is a typical boilerplate code
of which we had so much in Groundhog. This commit
introduces a way to get rid of it: a decorator that adds iteration
code to a single-step transition function.
Probably yes.. I should say that I don't really understand what they 
are. I just know that they are usually None for the forward-pass.. :)

I will add it to todo in the docstring.

On 22.10.2014 19:40, Bart van Merriënboer wrote:
>
> In blocks/bricks.py:
>
> > +
> > +                def scan_function(*args):
> > +                    args = list(args)
> > +                    arg_names = (inputs_given.keys()
> > +                            + states_given.keys()
> > +                            + contexts_given.keys())
> > +                    kwargs = dict(zip(arg_names, args))
> > +                    kwargs.update(rest_kwargs)
> > +                    return fun(self, **kwargs)
> > +                result, updates = theano.scan(scan_function,
> > +                        sequences=inputs_given.values(),
> > +                        outputs_info=states_given.values()
> > +                                + [None] * num_outputs,
> > +                        non_sequences=contexts_given.values(),
> > +                        go_backwards=reverse)
> > +                assert not updates
>
> I guess that eventually we'll need to come up with a way to actually 
> store these updates somewhere where they can be collected before 
> compiling the function.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/bartvm/blocks/pull/10/files#r19230352>.
>