-
Notifications
You must be signed in to change notification settings - Fork 137
Add support for Cropping1D and Cropping2D #289
Conversation
@jon-tow Cropping is a convolution operation, would suggest moving it to convolution.swift instead of making a new file. |
Oops. I assumed since it isn't a type of convolution I'd create a separate file. I will stick it in Convolution.swift as I see that's how Keras handles it. Is this correct @rxwei? Thanks for the heads up @Shashi456. |
This reverts commit bd7277e.
@Shashi456 Why do you believe that cropping is a convolution operation? I would just put it in a new file called |
@eaplatanios, just mostly following the keras api structure for now. |
I agree with Anthony here. |
Can we have a separate PR for refactoring the layers into image.swift? And pass this through? On some other note, it does make some sense to me that these layers are a part of convolution in keras, since they are mostly used in tandem with convolutional layers on images. |
This PR introduces a purely additive change, so it would make more sense to place |
@eaplatanios, do mention other layers you'd want to be a part of Image.swift, I just personally think that we should avoid over-granularity of Layers by separating them so much. Image.swift does make sense in this case though. |
@rxwei I'll add this into |
Yes. Thank you! |
Co-Authored-By: Richard Wei <rxwei@google.com>
@Shashi456 I haven't given this much thought other than the comment above, but there is lots of operations that are typically performed on images so I wouldn't this is granular. On the contrary, if we find that |
Co-Authored-By: Anthony Platanios <e.a.platanios@gmail.com>
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that 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 here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
1 similar comment
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that 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 here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
Co-Authored-By: Anthony Platanios <e.a.platanios@gmail.com>
Co-Authored-By: Richard Wei <rxwei@google.com>
I confirm! @googlebot |
@jon-tow Could you please merge with master? |
@eaplatanios Sorry for the late merge, was a bit busy. |
@eaplatanios This should be good to go! Please let me know if you'd like me to add anything. |
@rxwei I started tests, but could you please handle the CLA issue? |
@jon-tow if you handle the conflicts, I think this PR might be good to go as well. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@Shashi456 Thanks for the alert! Forgot about this one :) |
Hi @jon-tow Thank you very much for this PR, but I think that cropping-as-a-layer is relatively unused, and might be better served as a stateless function on Tensor instead. As a result, I'm going to close out this PR, but if you would like to discuss this further, let's definitely dedicate some time at an upcoming design meeting! All the best, |
Adding support for Cropping1D and Cropping2D along with tests for correctness. #54
Currently only supports cropping based on a channels last data format (Keras's default), until control flow differentiation is added.