Stateful RNNs now support recurrent_dropout
parent
33d1894dc1
commit
6f98bc5a04
|
@ -471,11 +471,10 @@
|
||||||
"source": [
|
"source": [
|
||||||
"model = keras.models.Sequential([\n",
|
"model = keras.models.Sequential([\n",
|
||||||
" keras.layers.GRU(128, return_sequences=True, stateful=True,\n",
|
" keras.layers.GRU(128, return_sequences=True, stateful=True,\n",
|
||||||
"# dropout=0.2, recurrent_dropout=0.2, # see TF issue #27829\n",
|
" dropout=0.2, recurrent_dropout=0.2,\n",
|
||||||
" batch_input_shape=[batch_size, None, max_id]),\n",
|
" batch_input_shape=[batch_size, None, max_id]),\n",
|
||||||
" keras.layers.GRU(128, return_sequences=True, stateful=True\n",
|
" keras.layers.GRU(128, return_sequences=True, stateful=True,\n",
|
||||||
"# dropout=0.2, recurrent_dropout=0.2 # see TF issue #27829\n",
|
" dropout=0.2, recurrent_dropout=0.2),\n",
|
||||||
" ),\n",
|
|
||||||
" keras.layers.TimeDistributed(keras.layers.Dense(max_id,\n",
|
" keras.layers.TimeDistributed(keras.layers.Dense(max_id,\n",
|
||||||
" activation=\"softmax\"))\n",
|
" activation=\"softmax\"))\n",
|
||||||
"])"
|
"])"
|
||||||
|
|
Loading…
Reference in New Issue