Skip to content
Snippets Groups Projects
Commit f1697b8d authored by Zachary Garrett's avatar Zachary Garrett
Browse files

Replace tf.log() with tf.math.log() and update arguments to tf.reduce_sum().

Pin to a previous tf-nightly version that is still TF 1.x compatible.

PiperOrigin-RevId: 272734678
parent 8d55fb7e
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,6 @@ RUN ${PIP} install --no-cache-dir \
tensorflow-model-optimization~=0.1.3 \
tensorflow-privacy~=0.0.1 \
tf-estimator-nightly==1.14.0.dev2019091601 \
tf-nightly \
tf-nightly==1.15.0.dev20190821 \
typing~=3.7.0
RUN pip freeze
......@@ -17,5 +17,5 @@ tensorflow-model-optimization~=0.1.3
tensorflow-privacy~=0.0.1
# TODO(b/141279425): Remove pinned tf-estimator-nightly version.
tf-estimator-nightly==1.14.0.dev2019091601
tf-nightly
tf-nightly==1.15.0.dev20190821
typing~=3.7.0
......@@ -193,9 +193,7 @@ def get_mnist_training_example():
tf.matmul(batch.x, model_vars.weights) + model_vars.bias)
loss = -tf.reduce_mean(
tf.reduce_sum(
tf.one_hot(batch.y, 10) * tf.log(pred_y),
reduction_indices=[1],
))
tf.one_hot(batch.y, 10) * tf.math.log(pred_y), axis=[1]))
grads = tape.gradient(loss, model_vars)
optimizer.apply_gradients(
zip(tf.nest.flatten(grads), tf.nest.flatten(model_vars)))
......
......@@ -84,7 +84,7 @@ REQUIRED_PACKAGES = [
'tensorflow-privacy~=0.0.1',
# TODO(b/141279425): Remove pinned tf-estimator-nightly version.
'tf-estimator-nightly==1.14.0.dev2019091601',
'tf-nightly',
'tf-nightly==1.15.0.dev20190821',
]
setuptools.setup(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment