google / prettytensor

Pretty Tensor: Fluent Networks in TensorFlow
1.24k stars 151 forks source link

lstm rnn example in tensorflow using pretty tensor api #22

Open vinayakumarr opened 8 years ago

vinayakumarr commented 8 years ago

lstm example

eiderman commented 8 years ago

The baby_names and shakespeare tutorials take as input integers and process them through an unrolled LSTM. The unrolling greatly helps with efficiency. These use numpy input, which is easy to use, but if your data is in the tensorflow Example format I can point you at how to process it.

You can stack the blocks as you please to produce a deep LSTM, but every cell in the network is individually gated.

Please take a look and let me know if you have any specific questions.

On Mon, Apr 25, 2016 at 11:40 PM, vinayakumarr notifications@github.com wrote:

I have data set (a part of data set is given below)

3 3 373 27 9 615 9 16 10 34 0 8 0 199 65917 1319 122 402 319 183 3 3 77 12 4 66 4 3 0 5 0 14 3 50 106 139 38 164 53 109 3 3 86 6 2 6 2 0 0 1 0 25 0 4 284 77888 19 66 11 25 3 3 469 21 7 291 7 43 15 82 0 207 0 181 115646 59073 294 928 112 675 3 3 2090 21 7 4035 7 17 8 40 0 317 10 717 1033 25661 142 2054 1795 1023 3 3 691 18 6 597 6 30 16 61 0 245 18 273 719 2352305 213 1106 324 719 6 6 229 0 8 526 0 11 1 13 0 6 5 101 7246 2082 120 141 288 1570 3 3 1158 9 3 649 3 16 6 17 1 247 38 477 592 987626 82 1305 653 707 4 4 211 0 10 429 0 16 9 20 0 3 0 106 42725 27302 4280 133 477 1567

The first column is the target which has 9 classes and around 1803 features i am having it. I am trying to apply lstm for this could you please a provide a sample code for this. also i am trying to implement lstm in

Two memory blocks with two cells each, four memory blocks with two cells each, four memory blocks with four cells each, and eight memory blocks with four cells each.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/google/prettytensor/issues/22

eiderman commented 8 years ago

The tutorials I was talking about are the ones in Pretty Tensor https://github.com/google/prettytensor/tree/master/prettytensor/tutorial. Except for the character -> int part, the rest should match your problem very well. You can make your LSTM deeper by just chaining sequence_lstm calls. In particular, since this is a classification problem baby_names https://github.com/google/prettytensor/blob/master/prettytensor/tutorial/baby_names.py should be helpful since it shows how to only train on a single prediction per example.

https://github.com/google/prettytensor/tree/master/prettytensor/tutorial https://github.com/google/prettytensor/blob/master/prettytensor/tutorial/baby_names.py

On Wed, Apr 27, 2016 at 1:53 AM, vinayakumarr notifications@github.com wrote:

I have tried in tensorflow.....could you please provide deep lstm and every cell in the network is individually gated example for my dataset or where can I find an example.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/google/prettytensor/issues/22#issuecomment-215016407