Robinysh / Passage-Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Text Generator

How to run: Run ./train.sh to train Run ./sample to generate bible See example (train.sh, sample.sh) and source code (train.py, sample.py) for further details.

Training general guidelines:

Hyperparameters obtained by trial and error: Number of layers: 2 Learning rate decay rate: ~0.97

Learning rate: 0.002~0.0004

RNN typical size varies from 256 to 2048, depends on computational time and desired accuracy. The higher the better but takes a longer computational time.

Dropout typically ranges from 1 to 0.5. Amount indicates keep probability. Decrease to reduce overfitting.

Number of epoch typically ~50. Increase if loss function does not reach convergence.

Batch size typically ranges from 20 to 50. Increase to speedup performance and smoothes convergence.

Examples

Trained on bible corpus

神說強盛的日子,乃為大名。 祭司烏利亞和民間的眾長老來,對他們說:你們是屬耶穌的,你們為我獻福的事,若是別人,更要讚美耶穌,在他裡面的罪人也沒有數目的,又要榮幼之所,又要加倍悖逆。 這人要去見神,和香氣和信奉耶穌的人,作他多有的,凡他所說的全都,當時就有福了。 我實在告訴你們,凡休妻另娶的,必要治死。 有法利賽人和撒迦利亞,和他的門徒同教的外貌。 (尼布甲人從會堂裡,從聖所中,除來,歸於無有,都沒有以前。 於是兵丁將保羅帶到雅各,名叫巴拉都住在希伯崙,在安息日醡不能從聖經落著無花果樹,直走到希律給他一個地方。 約有午正,要在那裡葬了他的靈魂,直等到日以色列就歡喜快樂麼。 我為這福音憂慮受苦勞,卻不算要在別人的心上,和大能的手,和伸出來的膀臂,從推羅的手下奪回。 請進父阿,你的音子倒在刀下,各人蒙恩。 百姓憂愁瞎子的眼,就是一位,又將神的國,與你們同受四十歲,給你們效力。

About


Languages

Language:Python 98.1%Language:Shell 1.9%