Friday, July 8, 2016

Mahabharata Using Recurrent Neural Networks and Long Short Term Memory

Wanted to test RNN [1] on Mahabharata [3]. JCJohnson's implementation [2] a fast implementation recommended by Karpathy.

Mahabharata is available from Project Gutenberg [3]. After data cleanup, ran the experiment to generate some data.

Generating 2000 characters, generates:

A: Drona Parva: Section CCLV 
this protect and approached thy breast. Beholding a friend of Santanu, O king's lronding to that effulgen ances died n it. If the common of this estraining every approving of those persons and 
heart, on his sons; have with husbanded Burnificate of Madhu is palace of the ruler of that daughter. Sharactents, and discoursed to the very sage 
and the carded. Tood (at the basze when they are iking that of Bharata to be milk'Thie kinds of end dragged of Brahmana rids and observarowhere that I regards us 
like that of a 
lore, who consume having who is one's soul, Krishna himself. The hundred intradavas entered thy tiger and religion of Sahadeva for the lord of the broking in the prevent, settled himself, O thou of arms, or Shikhandi, where) resting from pa fierce known into grief is the ye is the mind. Persons, the clouds. A 
auspicious asked his hungly cleansed nook nobodimal our child should as bestood then took along by conduct of gold, with me, K.P been warrior Bhishma most extermination. Thinal. They are bent of arms, weeping, and one with four duties of the great hommaded as only to the act, thy carried that business of great son of Viratishta, I will the quantition that consequently, five the breath (the ocean saying, whose angry 
luled (by all. Salutatir, that man, decority as if from which never hermitad of moon. Arrived ing Brahmanas at deep, O gover by the latter. Thy sires, Ketumishma, entrance. Peneemongst that subthe villages. 
All of wicked roaring in her as a well-knowled at weapons l Pandu's race. 
283:1 There, O thou wilt first 
hurl to this is the bare with great on his sinful achieve the Pitris, the prince, live his minds is matter of are enjoymentible, some immediately 
no dic Siva and Yay the loud behaviour and the driveranged for the inexhaustible. Of the minded them 
which a long of humble slain by mair from their brave vanquished for him all one for his shafts. Aven desirous of fruits. Many fear, that one who used t
RNN generates a good sample. However, data cleaning and formatting the data will make a great sample.

Reference
[1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/
[2] https://github.com/jcjohnson/torch-rnn
[3] http://www.gutenberg.org/cache/epub/7864/pg7864.txt

No comments:

Post a Comment