<p><span class="math-container">$ \gamma $</span> goes up to 1, but cannot be greater than or equal to 1 (this would make the discounted reward infinite).</p>

<p>The discount factor <span class="math-container">$ \gamma $</span>  determines the importance of future rewards. A factor of 0 will make the agent "myopic" (or short-sighted) by only considering current rewards, while a factor approaching 1 will make it strive for a long-term high reward. If the discount factor meets or exceeds 1, the action values may diverge. For <span class="math-container">$ \gamma =1$</span>, without a terminal state, or if the agent never reaches one, all environment histories become infinitely long, and utilities with additive, undiscounted rewards generally become infinite.</p>

<p>Source:<a href="https://en.wikipedia.org/wiki/Q-learning" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Q-learning</a>
<a href="https://cs.stanford.edu/people/karpathy/reinforcejs/puckworld.html" rel="nofollow noreferrer">https://cs.stanford.edu/people/karpathy/reinforcejs/puckworld.html</a></p>

CC BY-SA 4.0
2019-04-08T19:36:51.053Z
+1.  Exactly, simply set gamma to 1, or something very close to it.  Even the value of 0.99 generally works fine, and still avoids the terminal state search issue.
Amrinder Arora
CC BY-SA 4.0
2019-04-08T06:39:54.933Z
2019-04-08T06:39:54.933Z
I_Al-thamary
<p>You can't! As if you have a <span class="math-container">$\gamma$</span> greater than <span class="math-container">$1$</span> the specified sum for the q-learning will diverge! (goes to infinity in the future steps for <span class="math-container">$\gamma^n$</span>). To know more about that please more scrutinize on the specified formula for the q-learning.</p>

CC BY-SA 4.0
2019-04-07T21:01:52.513Z
2019-04-07T21:01:52.513Z
OmG
<p>If I have a DQN, and I care A LOT about future rewards (moreso than current rewards), can I set gamma to a number greater than 1? Like 1.1 perhaps?</p>

<q-learning><dqn>
Can gamma be greater than 1 in a DQN?
Shamoon
# Can gamma be greater than 1 in a DQN?

(Asked by: username_0 on 2019-04-07)

If I have a DQN, and I care A LOT about future rewards (moreso than current rewards), can I set gamma to a number greater than 1? Like 1.1 perhaps?

**Tags:** q-learning, dqn


---

## 2 answers

### Answer by username_1 on 2019-04-08. Score: 2

$ \gamma $ goes up to 1, but cannot be greater than or equal to 1 (this would make the discounted reward infinite).

The discount factor $ \gamma $ determines the importance of future rewards. A factor of 0 will make the agent "myopic" (or short-sighted) by only considering current rewards, while a factor approaching 1 will make it strive for a long-term high reward. If the discount factor meets or exceeds 1, the action values may diverge. For $ \gamma =1$, without a terminal state, or if the agent never reaches one, all environment histories become infinitely long, and utilities with additive, undiscounted rewards generally become infinite.

Source:<https://en.wikipedia.org/wiki/Q-learning>
<https://cs.stanford.edu/people/karpathy/reinforcejs/puckworld.html>

> **Comments:**
> **username_2**: +1.  Exactly, simply set gamma to 1, or something very close to it.  Even the value of 0.99 generally works fine, and still avoids the terminal state search issue.  

---

### Answer by username_3 on 2019-04-07. Score: 1

You can't! As if you have a $\gamma$ greater than $1$ the specified sum for the q-learning will diverge! (goes to infinity in the future steps for $\gamma^n$). To know more about that please more scrutinize on the specified formula for the q-learning.


---

