Questions tagged [q-learning]

Q-learning is a model-free reinforcement learning technique.

Q-learning is a model-free, on-policy reinforcement learning technique that aims to find an action-value function that gives the expected utility (reinforcement) of taking a given action in a given state and following a fixed policy thereafter.

One of the strengths of Q-learning is that it needs only a reinforcement function to be given (i.e. a function which tells how well, or how bad the agent is performing). During the learning process, the agent needs to balance exploitation (acting greedily in terms of current action-value function) vs exploration (action randomly to discover new states or better actions then currently estimated). A common simple example for handling this issue is using an epsilon-greedy policy.

447 questions
0
votes
1 answer

DQN unstable predictions

i implemented DQN from scratch in java, everything is custom made. I made it to play snake and results are really good. But i have a problem. To make network as stable as possible, im using replay memory and also target network. The network is…
0
votes
1 answer

Model doesn't seem to learn

I used this gym library to try and get this model to learn, but I don't think it learns from experience. Something is wrong, but I can't figure it out. I have played with the DISCOUNT, LEARNING_RATE, DISCRETE_OS_SIZE and still nothing, do i have to…
0
votes
3 answers

OpenAI "gym" Library throws a NoneType error on env.render()

This is my first time working with machine learning libraries, I used to make it all myself, and when I did it worked, but I guess that when everyone tells you not to do the job yourself and let the libraries do it for you, you eventually try, and I…
1Mangomaster1
  • 346
  • 1
  • 6
  • 16
0
votes
0 answers

Can you train the game "Snake" using Q learning (and not Deep Q Learning)

I saw so many examples showing people making it using Deep Reinforced Learning but that is something I am yet to know, I have learned supervised training methods and then I started learning Q learning thinking that maybe it will turn out more…
1Mangomaster1
  • 346
  • 1
  • 6
  • 16
0
votes
0 answers

Is there any way to store qlearning table in external file?

I'm sorry the title might be misleading. I'm currently working on a Q-Learning algorithm. I only can modify the Agent. And the runner doesn't implement episodes. Is there any way to make the agent store its learned q-values each time in a separate…
0
votes
1 answer

Implementing Neural Network in python using pygame and tensorflow

I have studied neural network theory and know how they work on a basic level. I have completed a few exercises on the coursera and I know how to define layers and train the network in Python but I can only do this on the sample datasets present. So…
0
votes
2 answers

Unknown Length Array, Assigning Any Part Of The Array Any Time

I am working with Q-Learning and want a 3D policy gradient that is completely empty until the the AI needs to access it. This is because my state is three inputs that each could be any integer from 1 to infinity, each number above 1 being…
user10034548
0
votes
1 answer

Does agent need to know reward function in advance in Reinforcement Learning?

Like Q learning we have reward feedback does that mean the agent need to know in advance?
Max
  • 35
  • 5
0
votes
1 answer

Python Q-learning implementation not working

I implemented a small simulation based on the sugarscape model in python. I have three classes in the program and when I try run the Q-learning algorithm I wrote the model converges into a single state and never changes where as when I run the model…
0
votes
1 answer

Size Mismatch when passing a state batch to network

Since I’m a beginner in ML, this question or the design overall may sound silly, sorry about that. I’m open to any suggestions. I have a simple network with three linear layers one of which is output layer. self.fc1 = nn.Linear(in_features=2,…
0
votes
0 answers

Why is my Deep Q Learning Network not learning?

I'm trying to build my own environement for study purposes in Q Learning and training it with a simple Neural Network and linear activation. The problem is, it doesn't seem to learn to play this simple game, which consists of the player reaching the…
ChrisP
  • 1
  • 2
0
votes
0 answers

np.argmax returning impossible value on Q table

I am experimenting with Q-learning using a super mario bros gym. I am trying to retrieve the best possible action using np.argmax, which should return something between 1-12. but it is returning values like 224440.. it's only returning this value…
0
votes
1 answer

Qlearning Epsilon-greedy exploration: Epsilon decay X fixed

I am teaching an agent to get out of a maze collecting all apples on its way using Qlearning. I read that is possible to leave a fixed epsilon or to choose an epsilon and decay it as time passes. I couldn't find the advantages or disadvantages of…
Catarina Nogueira
  • 1,024
  • 2
  • 12
  • 28
0
votes
1 answer

q-learning: ValueError: 'a' cannot be empty unless no samples are taken

i try to develop q-learning algorithm for reinforcement learning, this my code: import numpy as np R = np.matrix ([[-1, 0, -1, -1, 0, -1, -1, -1, -1], [-1, -1, 100, 0, -1, -1, -1, -1, -1], [-1, -1, 100, -1, -1, -1, -1, -1,…
student
  • 31
  • 1
  • 8
0
votes
1 answer

How to define output layer shape of DQN model in Keras

i am trying to learn DQN agent to play Tic Tac Toe using Keras. Issue is that my output has different shape than I expected. Details: Input shape : (BOARD_SIZE ^ 2) * 3 --> It is one hot encoded game board Output shape: I expect that output will…