Unverified Commit 32fadf00 authored by Hongkun Yu's avatar Hongkun Yu Committed by GitHub
Browse files

Merged commit includes the following changes: (#7255)

258881002  by hongkuny<hongkuny@google.com>:

    Fix lint.

--
258874998  by hongkuny<hongkuny@google.com>:

    Internal

--
258872662  by hongkuny<hongkuny@google.com>:

    Fix doc

--
258871624  by hongkuny<hongkuny@google.com>:

    Internal change

PiperOrigin-RevId: 258881002
parent 1fb34e76
...@@ -135,6 +135,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam): ...@@ -135,6 +135,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
return super(AdamWeightDecay, self).apply_gradients(zip(grads, tvars)) return super(AdamWeightDecay, self).apply_gradients(zip(grads, tvars))
def _get_lr(self, var_device, var_dtype, apply_state): def _get_lr(self, var_device, var_dtype, apply_state):
"""Retrieves the learning rate with the given state."""
if apply_state is None: if apply_state is None:
return self._decayed_lr_t[var_dtype], {} return self._decayed_lr_t[var_dtype], {}
......
...@@ -14,18 +14,18 @@ Note that files other than shakepeare.txt can also be used to train the model to ...@@ -14,18 +14,18 @@ Note that files other than shakepeare.txt can also be used to train the model to
Then train the model: Then train the model:
``` ```python
python3 shakespeare_main.py --training_data shakespeare.txt \ python3 shakespeare_main.py --training_data shakespeare.txt \
--model_dir /tmp/shakespeare --model_dir /tmp/shakespeare
```` ```
This will place model checkpoints in `/tmp/shakespeare`, so that we can use them to make predictions. This will place model checkpoints in `/tmp/shakespeare`, so that we can use them to make predictions.
Then generate predictions: Then generate predictions:
``` ```python
python3 shakespeare_main.py --training_data shakespeare.txt \ python3 shakespeare_main.py --training_data shakespeare.txt \
--model_dir /tmp/shakespeare --notrain --predict_context=ROMEO: --model_dir /tmp/shakespeare --notrain --predict_context=ROMEO:
``` ```
Change `--predict_context` and `--predict_length` to suit your needs. Change `--predict_context` and `--predict_length` to suit your needs.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment