<p>I have to answer my question. 
Consider that all patches have the same value. Then choosing a patch uniformly and selecting a random point uniformly on that patch is as the same as sampling the hemisphere uniformly. If <span class="math-container">$p_s=Pr(Q_k \in Q)=1/n$</span>, which n is the number of patches, I can conclude that <span class="math-container">$p_\omega=p_s*(n/2\pi)=1/2\pi$</span> .</p>

<p>And if patches don't have the same value, then <span class="math-container">$p_s=Pr(Q_k \in Q)=q_k/(q_1+...+q_n)$</span> and 
<span class="math-container">$p_\omega=p_s*(n/2\pi)=(q_k/(q_1+...+q_n))*(n/2\pi)$</span></p>

CC BY-SA 4.0
2019-11-06T18:22:27.437Z
The whole point of this method is that patches wouldn't have the same value, that's where you gain something.
lightxbulb
CC BY-SA 4.0
2019-11-06T17:35:34.677Z
2019-11-06T17:35:34.677Z
bitWise
<p>It's the algorithm which combines path tracing and reinforcement learning. I can't understand what <span class="math-container">$p_\omega$</span> is. </p>

<p><a href="https://i.sstatic.net/PWbSf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PWbSf.png" alt="enter image description here"></a></p>

<p>The algorithm is clear. The actions are the directions and the states are the hit points. For updating the Q-values, the hit points are considered as parts of a discretized diagram like Voronoi diagram and the directions of rays are generated by a discretization of a hemisphere surface which divides it into equal areas. The Q-values are initialized as equal for each state. </p>

<p>First, we generate a camera ray, and when it hits a diffuse surface, it scatters according to a discrete PDF which is calculated by normalizing the Q-values of the state of hit point. </p>

<p>Second, The Q-values are updated along the path, we have the state <span class="math-container">$s$</span> and the next state <span class="math-container">$s\prime$</span> is generated from the direction generated by PDF of Q-values in <span class="math-container">$s$</span>. </p>

<p>The area of each path on the hemispheres is <span class="math-container">$2\pi/n$</span>, and integral in the update equation of Q-values is calculated like this:</p>

<p><span class="math-container">$\dfrac{2\pi}{n}\sum_{k=0}^{n-1}Q_k(y)f_s(\omega_k, y, -\omega)cos\theta_k$</span></p>

<p>I understand all of the algorithm, but I don't know what <span class="math-container">$p_\omega$</span> is in the second part. Is it <span class="math-container">$1/2\pi$</span> or <span class="math-container">$n/2\pi$</span> ? Could someone prove what it really is? I need the proof. </p>

<p>I guess it is <span class="math-container">$1/2\pi$</span> because the path tracer here only use the PDF generated by Q-values. It doesn't use the Q-values at all. Am I correct? If I am correct, how can I prove it?</p>

<p>EDIT: For clarification, a ray generated through a patch uniformly and the Q-values are generated as I said. Because we only change the directions so more samples are generated inside the patches which receive more light. </p>

<p>I used <span class="math-container">$n/2\pi$</span> , but scene was so dark, so the PDF must be either <span class="math-container">$1/2\pi$</span> or a normalized combination of PDF's of patches. If the second is true, what it really is?</p>

<p>EDIT 2: Should I ask this question in the statistics community of stack exchange?</p>

CC BY-SA 4.0
2019-11-06T15:58:48.370Z
I haven't looked into this beyond what you posted, but this seems like the probability with which you sampled your new ray. Since it mentions proportional to Q, I am assuming you do some inverse transform sampling, so you need to take it into account.
lightxbulb
<raytracing>
What is the PDF for path tracing in the paper "Learning the light transport the reinforced way
bitWise
# What is the PDF for path tracing in the paper "Learning the light transport the reinforced way

(Asked by: username_0 on 2019-11-06)

It's the algorithm which combines path tracing and reinforcement learning. I can't understand what $p\_\omega$ is.

[![enter image description here](https://i.sstatic.net/PWbSf.png)](https://i.sstatic.net/PWbSf.png)

The algorithm is clear. The actions are the directions and the states are the hit points. For updating the Q-values, the hit points are considered as parts of a discretized diagram like Voronoi diagram and the directions of rays are generated by a discretization of a hemisphere surface which divides it into equal areas. The Q-values are initialized as equal for each state.

First, we generate a camera ray, and when it hits a diffuse surface, it scatters according to a discrete PDF which is calculated by normalizing the Q-values of the state of hit point.

Second, The Q-values are updated along the path, we have the state $s$ and the next state $s\prime$ is generated from the direction generated by PDF of Q-values in $s$.

The area of each path on the hemispheres is $2\pi/n$, and integral in the update equation of Q-values is calculated like this:

$\dfrac{2\pi}{n}\sum\_{k=0}^{n-1}Q\_k(y)f\_s(\omega\_k, y, -\omega)cos\theta\_k$

I understand all of the algorithm, but I don't know what $p\_\omega$ is in the second part. Is it $1/2\pi$ or $n/2\pi$ ? Could someone prove what it really is? I need the proof.

I guess it is $1/2\pi$ because the path tracer here only use the PDF generated by Q-values. It doesn't use the Q-values at all. Am I correct? If I am correct, how can I prove it?

EDIT: For clarification, a ray generated through a patch uniformly and the Q-values are generated as I said. Because we only change the directions so more samples are generated inside the patches which receive more light.

I used $n/2\pi$ , but scene was so dark, so the PDF must be either $1/2\pi$ or a normalized combination of PDF's of patches. If the second is true, what it really is?

EDIT 2: Should I ask this question in the statistics community of stack exchange?

**Tags:** raytracing

> **Comments:**
> **username_1**: I haven't looked into this beyond what you posted, but this seems like the probability with which you sampled your new ray. Since it mentions proportional to Q, I am assuming you do some inverse transform sampling, so you need to take it into account.  

---

## 1 answers

### Answer by username_0 on 2019-11-06. Score: 1

I have to answer my question.
Consider that all patches have the same value. Then choosing a patch uniformly and selecting a random point uniformly on that patch is as the same as sampling the hemisphere uniformly. If $p\_s=Pr(Q\_k \in Q)=1/n$, which n is the number of patches, I can conclude that $p\_\omega=p\_s\*(n/2\pi)=1/2\pi$ .

And if patches don't have the same value, then $p\_s=Pr(Q\_k \in Q)=q\_k/(q\_1+...+q\_n)$ and
$p\_\omega=p\_s\*(n/2\pi)=(q\_k/(q\_1+...+q\_n))\*(n/2\pi)$

> **Comments:**
> **username_1**: The whole point of this method is that patches wouldn't have the same value, that's where you gain something.  

---

