tensorflowbook icon indicating copy to clipboard operation
tensorflowbook copied to clipboard

Chapter 6?

Open camrongodbout opened this issue 8 years ago • 9 comments

Is any code available from chapter 6 particularly the Char RNN?

camrongodbout avatar Aug 01 '16 17:08 camrongodbout

I'm looking for the chapter code 6 code too. Thanks!

vgoklani avatar Aug 01 '16 21:08 vgoklani

Hey guys! I'll do what I can to get it up in the next day or two!

samjabrahams avatar Aug 02 '16 02:08 samjabrahams

Thanks! and thanks for writing the book!!! If you're even in NYC one day, let's grab coffee.

vgoklani avatar Aug 02 '16 02:08 vgoklani

Really enjoying the book. Thank you! Looking forward to the Chapter 6 code.

wfs avatar Aug 07 '16 05:08 wfs

Just wanted to provide an update: this has not been forgotten! I'm just over halfway cleaning up the code and setting up to be run "out-of-the-box" from the repo. The past week has been nuts with travel.

SOON™

samjabrahams avatar Aug 10 '16 07:08 samjabrahams

I've gone through and added full, functioning-out-of-the-box code for chapter 6. I still want to clean up a few things as well as add Python 2 versions of everything (a few libraries shifted between 2.7 and 3+), but you can start toying around with the examples! Here's a generated arXiv abstract on a hastily trained network from the final example in the chapter:

Win on a Tesla K40c GPU benefiting deep learning framework for human posers for ternail arn performance representation performed sortimate visual smy practic of different types of recurrent also describes the distingy by trained Deep Neural Networks are describes the difter op ining state-yperformentank Neural Network (CNN) on 4 data sets, space. The provided as the state of the art method ob structures deep neural networks can be trained from ImageNet, and extract, search datasets than a conventio

samjabrahams avatar Aug 13 '16 07:08 samjabrahams

Hi,

I tried to use the code from chapter 6 in an interactive python session, but I get the following error:

ValueError: Variable rnn/gru_cell/gates/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

File "", line 83, in prediction sequence_length=self.length, File "", line 65, in init self.prediction File "", line 173, in model = SequenceLabellingModel(data, target, params)

Any ideas? Thanks!

I have found a fix, by adding a reuse member and setting it in prediction like this: @property def prediction(self): output, _ = tf.nn.dynamic_rnn( tf.contrib.rnn.GRUCell(self.params.rnn_hidden, reuse=self.reuse), self.data, dtype=tf.float32, sequence_length=self.length, ) if not self.reuse: self.reuse = True

cgmircea avatar Aug 21 '17 09:08 cgmircea

I also have a gist for a char-rnn in TensorFlow that works very similar to the one described in the book: https://gist.github.com/danijar/c70e7f7811231ce0cecceea76d07ffed

danijar avatar Sep 26 '17 10:09 danijar

i run the char-rnn code and got this ValueError: Dimensions must be equal, but are 400 and 283 for 'rnn/while/rnn/multi_rnn_cell/cell_0/cell _0/gru_cell/MatMul_2' (op: 'MatMul') with input shapes: [?,400], [283,400]. with tf version 1.4.1

mupengX avatar Dec 24 '17 10:12 mupengX