New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a test for deepfm #1442
add a test for deepfm #1442
Conversation
"ElasticDL Tensor ignores dense_shape in " | ||
"TensorFlow.IndexedSlices." | ||
) | ||
# TODO(yunjian.lmh): Support dense shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will generate too many warnings. So I remove it.
): | ||
self.expected_embed_table[gi] -= self._lr * gv | ||
|
||
self.embedding_grads1 = tf.IndexedSlices( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to address the issue here, refine the unit test.
y, | ||
) | ||
acc = acc_meter.result().numpy() | ||
print("loss: ", w_loss.numpy(), " acc: ", acc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -266,6 +270,67 @@ def test_worker_pull_embedding(self): | |||
expected_result = np.concatenate(expected_result) | |||
self.assertTrue(np.allclose(expected_result, result_dict[layer])) | |||
|
|||
def test_deepfm_train(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract the common training logic of test_deepfm_train
and test_mnist_train
as a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Fix #1441