Skip to content
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

gradient computation #20

Open
ZhipengCai opened this issue Jul 16, 2022 · 3 comments
Open

gradient computation #20

ZhipengCai opened this issue Jul 16, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@ZhipengCai
Copy link

Hi, thanks for the great work. I have a question regarding to the gradient computation in

// compute gradients by math...
dL_drgbs[s][0] = dL_drgb[ray_idx][0]*w;
dL_drgbs[s][1] = dL_drgb[ray_idx][1]*w;
dL_drgbs[s][2] = dL_drgb[ray_idx][2]*w;
dL_dsigmas[s] = deltas[s] * (
dL_drgb[ray_idx][0]*(rgbs[s][0]*T-(R-r)) +
dL_drgb[ray_idx][1]*(rgbs[s][1]*T-(G-g)) +
dL_drgb[ray_idx][2]*(rgbs[s][2]*T-(B-b)) +
dL_dopacity[ray_idx]*(1-O) +
dL_ddepth[ray_idx]*(t*T-(D-d))
);
dL_drgb_bg[0] = dL_drgb[ray_idx][0]*(1-O);
dL_drgb_bg[1] = dL_drgb[ray_idx][1]*(1-O);
dL_drgb_bg[2] = dL_drgb[ray_idx][2]*(1-O);

Can you explain slightly on how you get the formula of dL_dsigmas[s]? i.e., why does
dL_dsigmas[s] = deltas[s] * (
dL_drgb[ray_idx][0](rgbs[s][0]T-(R-r)) +
dL_drgb[ray_idx][1]
(rgbs[s][1]T-(G-g)) +
dL_drgb[ray_idx][2]
(rgbs[s][2]T-(B-b)) +
dL_dopacity[ray_idx]
(1-O) +
dL_ddepth[ray_idx]
(t*T-(D-d))
)

@kwea123
Copy link
Owner

kwea123 commented Jul 16, 2022

I have a simple writeup here. Feel free to ask any question if there is still any.
https://app.conceptboard.com/board/2hua-puao-fets-rpcd-x7no

@kwea123 kwea123 pinned this issue Jul 16, 2022
@kwea123 kwea123 added the documentation Improvements or additions to documentation label Jul 16, 2022
@kwea123 kwea123 closed this as completed Jul 16, 2022
@kwea123
Copy link
Owner

kwea123 commented Aug 28, 2022

TODO: add note about gradient w.r.t. the weights that is added recently.

@kwea123 kwea123 reopened this Aug 28, 2022
@jnhwkim
Copy link

jnhwkim commented Jun 16, 2023

@kwea123 I found that the definition of opacity is different in the ConceptBoard. Please take a look at my PR #133.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants