added image-gradients (#4763) [1/2]#5056
added image-gradients (#4763) [1/2]#5056SkafteNicki merged 25 commits intoLightning-AI:release/1.2-devfrom pranjaldatta:add-image-gradient
Conversation
|
Hi @pranjaldatta is the image gradient metric not defined as the difference between the image gradient of a ground true image and a predicted image? |
Hey @SkafteNicki, image-gradient functions by definition return dy/dx of a single image. (following from sklearn/TF implementations). If you are referring to a class-based (like here), that can be done, but I assumed since image-gradients are usually added as a base to loss functions like depth loss, etc., it would make more sense to have a depth-loss metric implemented separately (class and functional) and functional implementation of image-gradients that is used by these metrics and can be used otherwise also. I wanted to add depth-loss too, but I read in the guidelines that a single PR should only cater to a single issue, hence I thought adding depth-loss would be violating those. But I'll be happy to make any changes if you could guide me a bit regarding the correct approach. |
|
@pranjaldatta okay I better understand the purpose of this PR now. |
@SkafteNicki I have changed the name of the PR. I intend on opening another Issue regarding depth-loss that builds on this. Hope this is appropriate. |
Codecov Report
@@ Coverage Diff @@
## release/1.2-dev #5056 +/- ##
===============================================
Coverage 93% 93%
===============================================
Files 147 148 +1
Lines 10419 10441 +22
===============================================
+ Hits 9652 9674 +22
Misses 767 767 |
|
I understand that a lot of tests are failing and I see that almost all of them have something to do with "PyTorch compiled without the CUDA version". Is this because I am using the CPU-only version of PyTorch installed via pip? How can I solve this? Considering I am a bit of a beginner when it comes to OSS contributions, I would be incredibly grateful for a bit of help here. |
|
There is a single test failing: related to docker. I cannot understand whether the error is something to do with the code or it's some transient error. Any help is highly appreciated. |
|
Hi @pranjaldatta, sorry for not getting back to you before now. Could you please add a reference to your metric in https://github.com/PyTorchLightning/pytorch-lightning/blob/master/docs/source/metrics.rst |
|
Hey @SkafteNicki, no worries. |
Yes that seems to be the appropriate place. Please, also add a note in the changelog file under the "added" section. |
|
Hey @SkafteNicki, I have updated the docs and changelog as asked! |
SkafteNicki
left a comment
There was a problem hiding this comment.
PR is looking good :]
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
|
@SkafteNicki added a commit making all the recommended changes. |
|
@pranjaldatta I still see many comments and sure if they are implemented or not, mind chek them and if they are done, pls mark them as resolved... |
|
@Borda Sorry about the clutter, all the conversations had been solved with the last commit. Have resolved all of them now! |
|
@Borda I have made the changes via the last commit! |
What does this PR do?
Fixes #4763
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃