viking-sudo-rm / stacknn-core

Pip-installable differentiable stacks in PyTorch!
65 stars 2 forks source link

Demo? #2

Open srush opened 4 years ago

srush commented 4 years ago

This library looks really nice. Is there a demo? I couldn't completely figure out the API from the docs.

viking-sudo-rm commented 4 years ago

My bad, completely missed this issue until now!

I had a private repo of some preliminary experiments I was doing using the library, mostly focused on language modeling and grammar induction-y stuff. I just made it public to serve as a demo. Probably the best example is this file:

https://github.com/viking-sudo-rm/stacks/blob/master/src/modules/stack_encoder.py

This class implements a stack RNN layer where a controller network predicts a policy for actions on the stack. The sequence of controller representations is also used as the output of the layer.