# Trying to use QLearning in a custom MDP environment. Chooses action 0 every time, despite the heavy negative reward

**URL:** <https://community.konduit.ai/t/trying-to-use-qlearning-in-a-custom-mdp-environment-chooses-action-0-every-time-despite-the-heavy-negative-reward/1024>\
**Category:** RL4J\
**Created:** [December 1, 2020, 3:04pm UTC](https://community.konduit.ai/t/trying-to-use-qlearning-in-a-custom-mdp-environment-chooses-action-0-every-time-despite-the-heavy-negative-reward/1024 "2020-12-01T15:04:33Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ErblinIsaku](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/erblinisaku/32/547_2.png) [@ErblinIsaku](https://community.konduit.ai/u/ErblinIsaku)\
**Post date:** [May 6, 2021, 6:11pm UTC](https://community.konduit.ai/t/trying-to-use-qlearning-in-a-custom-mdp-environment-chooses-action-0-every-time-despite-the-heavy-negative-reward/1024/21 "2021-05-06T18:11:52Z")

</div>

Oh it worked! Thank you very much for all your help, I really appreciate it 😄

BTW, what kind of parameters/hyperparameters do you suggest to have a “balanced” observation, are the above mentioned (batch size, no-op warmup and learning rate) good ones to have for execution and running?

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [May 6, 2021, 6:15pm UTC](https://community.konduit.ai/t/trying-to-use-qlearning-in-a-custom-mdp-environment-chooses-action-0-every-time-despite-the-heavy-negative-reward/1024/22 "2021-05-06T18:15:48Z")

</div>

Just start with some sane defaults. I guess a batchsize of at least 64 and a learning rate of at most 10^-3 with an L2 of at most one order of magnitude less than the learning rate.

In your case, I don’t think it makes sense for you to have a warm up phase at all. And you probably want to keep epsilon (the rate of random exploration) at 0.1

---

<div class="post-metadata">

**Author:** ![ErblinIsaku](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/erblinisaku/32/547_2.png) [@ErblinIsaku](https://community.konduit.ai/u/ErblinIsaku)\
**Post date:** [May 6, 2021, 6:22pm UTC](https://community.konduit.ai/t/trying-to-use-qlearning-in-a-custom-mdp-environment-chooses-action-0-every-time-despite-the-heavy-negative-reward/1024/23 "2021-05-06T18:22:21Z")

</div>

I understand, thank you again for your support!  
All the best!

[Previous page](https://community.konduit.ai/t/trying-to-use-qlearning-in-a-custom-mdp-environment-chooses-action-0-every-time-despite-the-heavy-negative-reward/1024.md?page=1)
