reinforcement-learning

Cartpole problem: Too many values to unpack (expected 4)

Cartpole problem: Too many values to unpack (expected 4) Question: The code for the classic reinforcement learning Cartpole problem throws up an error: ValueError: too many values to unpack (expected 4) when the following code is used: # Take action and observe next state and reward next_state, reward, done, info = env.step(action) Asked By: Kebasita …

Total answers: 1

How to verify if the tensorflow code trains completely in FP16?

How to verify if the tensorflow code trains completely in FP16? Question: I’m trying to train a TensorFlow (version 2.11.0) code in float16. I checked that FP16 is supported on the RTX 3090 GPU. So, I followed the below link to train the whole code in reduced precision. https://www.tensorflow.org/api_docs/python/tf/keras/backend/set_floatx Then, When I was testing the …

Total answers: 1

Problem getting DQN to learn CartPole-v1 (PyTorch)

Problem getting DQN to learn CartPole-v1 (PyTorch) Question: So I had my DQN training fine, solves the environment after ~65_000 iterations. However, I started working on something else and now it’s completely broken and won’t get to even close to the same level anymore. Following advice from previous work, I tuned hyperparameters and still didn’t …

Total answers: 1

Numpy – How to get an array of the pattern gamma^t for some 0-t?

Numpy – How to get an array of the pattern gamma^t for some 0-t? Question: I am creating a basic gridworld RL problem and I need to calculate the return for some given episode. I currently have the array of rewards, and I would like to element-wise multiply this with a list of the form: …

Total answers: 1

Get the neural network weights out of a Tensorflow `Graph`

Get the neural network weights out of a Tensorflow `Graph` Question: I’m using RLlib to train a reinforcement learning policy (PPO algorithm). I want to see the weights in the neural network underlying the policy. After digging through RLlib’s PPO object, I found the TensorFlow Graph object. I thought that I would find the weights …

Total answers: 1

Whenever I try to use env.render() for OpenAIgym I get "AssertionError"?

Whenever I try to use env.render() for OpenAIgym I get "AssertionError"? Question: I am trying to learn Reinforcement learning. I wanted to build a Reinforcement Learning model for autonomous driving. However, whenever I use env.render() while training the Reinforcement learning model. It gives me an assertion error. The code is as below for my model: …

Total answers: 1

Ray monitoring fails when binding to empty address

Ray monitoring fails when binding to empty address Question: I’m learning to use RLlib. I’ve been running it in my debugger on an example script, and it works, but for some reason I get an error message about the monitoring service failing. This is the traceback: File "/home/ramrachum/.venvs/ray_env/lib/python3.10/site-packages/ray/autoscaler/_private/monitor.py", line 600, in <module> monitor = Monitor( …

Total answers: 1

Best way to create classes that only differ by one method?

Best way to create classes that only differ by one method? Question: I am implementing multiple RL agents which share a lot of common attributes and methods but differ in only one. Namely the one that calculates the td_error. Out of the top of my head I can think of 3 options to implement this: …

Total answers: 1

Can't import VecFrameStackFrame from Stable-baselines3 – importing problem

Can't import VecFrameStackFrame from Stable-baselines3 – importing problem Question: I have a problem when importing some dependencies from stable baselines 3 library, I installed it with this command pip install stable-baselines3[extra] But When I import my dependencies import gym from stable_baselines3 import A2C from stable_baselines3.common.vec_env import VecFrameStackFrame from stable_baselines3.common.evaluation import evaluate_policy from stable_baselines3.common.env_util import make_atari_env …

Total answers: 1