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
[Clustering] Fixing the bug in clustering for Conv1D/Conv3D #609
[Clustering] Fixing the bug in clustering for Conv1D/Conv3D #609
Conversation
Change-Id: Ic1ee16760d9643b8142e5644d6cb68a6890bc621
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.
Thanks. Looks like we need a similar test and fix for Conv1D.
Change-Id: Ic20345f29b6548e7eabf34fe5488654284987a83
Change-Id: Icd0acb2c5a671d4cafc3222fcc4d8098716b3f73
Change-Id: If55e372e7f13fc032f4b85d7e449ed0ecaf6a873
Change-Id: Ib4331480e2d29a24973a15fb5d2cbcf05e051b91
@psunn, please review |
LGTM, thanks! |
@@ -199,6 +202,54 @@ def testDepthwiseConv2DLayerNonClusterable(self): | |||
wrapped_layer) | |||
self.assertEqual([], wrapped_layer.layer.get_clusterable_weights()) | |||
|
|||
@keras_parameterized.run_all_keras_modes | |||
def testConv1DLayer(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.
Nit: """Verifies that we can cluster a Conv1D layer.""" Should be a one-liner
""" | ||
Verifies that we can cluster a Conv3D layer. | ||
""" | ||
input_shape =(4, 28, 28, 28, 1) |
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.
Same as above:
[tf.reshape(self.cluster_centroids, [1 for _ in range(wt_dim-2)] + [clst_num])] * | ||
weight.shape[-2], axis=wt_dim-2), | ||
[i for i in weight.shape[:-2]] + [1, 1])] * weight.shape[-1], | ||
axis=wt_dim-1) |
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.
Seems a little clunky with all the list comprehensions, is it possible to make this a bit more readable?
1. Nits: Docstring corrections 2. Simplify clunky code in get_pulling_indices Change-Id: I3c6818099fab1c9b844620cd1dfad6e97efeb0fd
Hi @daverim Thanks for the review! Your comments are addressed. Please take a look. |
Change-Id: I367607cb123404f72da7b4a592a70d154d14ed13
Hey sorry, is this PR still required? Can you rebase? |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
Change-Id: Ied79f7dfe484770d41dc9b08ae3b5acdbd970e54
@googlebot I signed it! |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
1 similar comment
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There is a bug in clustering for Conv1D/Conv3D. We used the layout for Conv2D and this is wrong, because tensors for Conv1D/ Conv3D have different ranks. Tests for both cases are added.