"git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "6750b53d2017010849ec8d66ba740f310fc30425"
Unverified Commit ab8febd4 authored by Hongkun Yu's avatar Hongkun Yu Committed by GitHub
Browse files

Merged commit includes the following changes: (#7289)

259649972  by hongkuny<hongkuny@google.com>:

    Update docs.

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

    Adds a dedup phase for trainable variables.

--

PiperOrigin-RevId: 259649972
parent 9d8c9aa4
# BERT in TensorFlow # BERT (Bidirectional Encoder Representations from Transformers)
Note> Please do not create pull request. This model is still under development Note> Please do not create pull request. This model is still under development
and testing. and testing.
......
...@@ -242,7 +242,8 @@ def run_customized_training_loop( ...@@ -242,7 +242,8 @@ def run_customized_training_loop(
model_outputs = model(inputs) model_outputs = model(inputs)
loss = loss_fn(labels, model_outputs) loss = loss_fn(labels, model_outputs)
tvars = model.trainable_variables # De-dupes variables due to keras tracking issues.
tvars = list(set(model.trainable_variables))
grads = tape.gradient(loss, tvars) grads = tape.gradient(loss, tvars)
optimizer.apply_gradients(zip(grads, tvars)) optimizer.apply_gradients(zip(grads, tvars))
# For reporting, the metric takes the mean of losses. # For reporting, the metric takes the mean of losses.
......
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