Comments (4)
Hi, I have same problem as you. And I found another problem https://github.com/yifita/DSS/issues/9
from dss.
I implemented my own dRho computation. I cannot guarantee it is correct, but it hasn't messed anything up for me so far. I replaced lines 276-287 from the rasterize function with this:
if ctx.needs_input_grad[0]:
# dI/drho(x) = ( WsMap_ - pixels*h)/(sumRho)
# Note that this gradient is back-proped to rho, not \overline{rho} (like the paper says)
# This can be done because computationally the same gradient would occur since the
# gradient for \overline{rho} at pixels outside the ellipse of rho are all 0.
WsMap_ = torch.where(isBehind.unsqueeze(-1),
torch.zeros(1, 1, 1, 1, 1, device=WsMap.device, dtype=WsMap.dtype),
WsMap)
h = (rhoMap_filtered > 0).double() # Easy way to get h function!
dRho = (WsMap_ - pixels.unsqueeze(3).repeat(1, 1, 1, 5, 1)*h.unsqueeze(-1))/sumRho.unsqueeze(-1)
dRho = gradPixels.unsqueeze(3)*dRho
# Invert the mapping so the gradient is back-propped to appropriate BB rho
# rhoMap = _gather_maps(rho.reshape(batchSize, -1, 1), totalIdxMap, 0.0).squeeze(-1)
# BATCHES MUST HAVE POINTS IN THE SAME ORDER... OTHERWISE THIS RE-ORDER WILL NOT WORK
dRho = _guided_scatter_maps(numPoint*bbWidth*bbHeight, dRho,
totalIdxMap, torch.repeat_interleave(boundingBoxes, bbWidth*bbHeight, 1))
dRho = dRho.reshape(batchSize, -1, bbHeight, bbWidth)
else:
dRho = None
Then I removed all "detach()" when computing rho. Hope this helps others!
from dss.
Thank you @bango123 !
I'm curious about your motivation to derive \rho or \bar{\rho}? Do you want to further derive \rho w.r.t. point positions and normals?
from dss.
Hello @yifita! Thank you for releasing this code base and your paper is really high quality btw.
I am doing a research project which is reconstructing from point based geometry and your work seemed like a perfect fit for it. So I put in the time to really understand your work and code implementation.
From your paper, it looks like these are the derivatives wanted (after approximating dh/dn = 0):
And from my understanding of your code, this function (DSS rasterize) is where dI/dw, dI/ \bar{rho}, dI/h are all computed. I noticed dI/ \bar{rho} is never computed, so I tried my hand at implementing it (code above) in an effort to better understand how things work.
However, as you probably already know, it looks like adding \bar{rho} w.r.t to points and normals (i.e. dI/ \bar{rho}) makes very little difference to the gradients. I am guessing that is because your approximated gradient for dI/dh is so much larger in magnitude.
tl;dr wanted to learn about your code/paper, so I tried to fix something. The "fix" appears to make little difference.
from dss.
Related Issues (20)
- Missing positional argument when constructing empy PointFragment HOT 1
- undefined symbol HOT 1
- Several errors HOT 6
- Confused about learn_color HOT 3
- Using custom renderer to generate mvr data HOT 4
- How to compute the gradient of the regularization terms and update point and normal( Eq 15,16)?
- Supporting for newer pytorch version HOT 1
- Negative GVdets
- issue about Iso-Points
- RuntimeError: Tensors must have same number of dimensions: got 4 and 5 HOT 3
- AttributeError: _evt HOT 2
- ValueError: Invalid vertices in file. HOT 2
- Visualization of the results HOT 2
- Unused config learning rate
- Reproduce Results in Fig. 3 HOT 3
- Pix2Pix results
- Issue with running demo HOT 2
- problem with dense depth HOT 1
- imageio version 2.8.0 does not support exr! HOT 2
- Confused with the backward of RasterizeAutograd HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dss.