Hi, I got a wonderful task for you to implement. In the past you helped me implement…
- User
Hi, I got a wonderful task for you to implement. In the past you helped me implement many such tasks. I hope you have great time implementing this as well. TASK: The goal of this task which comprises of two parts is to implement the actor-critic algorithm and apply it to solve OpenAI gym environments. I'll provide you the structure of the implementation.
Part I - Implementing Q Actor-Critic
Here is the Algorithm for Q Actor Critic Initialize parameters s, 0, w and learning rates ae, aw; sample a~ To (als). for t 1...T: do s'~ P(s's, a) Sample reward rt ~ R(s, a) and next state s' Then sample the next action a'~ Te (a's') Update the policy parameters: ←0 + αo Qw (s, a) Ve log Te (als); Compute the correction (TD error) for action-value at time t: dt = rt+YQw (s', a') - Qw (s, a) and use it to update the parameters of Q function: ww+αw St VwQw (s, a) Move to a a' and s← s' end for In this part we will implement an actor-critic algorithm and test it on any simple environment which I'll provide you down below.-
Implement the Q actor-critic algorithm. You may use any framework (Keras/Tensorflow/Pytorch).Choose the best , efficient, framework for our task. In this Part we need to implement only Q Actor-Critic version. Any other variations will not be allowed.
-
Train your implemented algorithm on the GridWorld Env given below.
-
Plots should include the total reward per episode and other metrics to check the performance of our model.
-
Provide the evaluation results. Run your environment for at least 10 episodes, where the agent chooses only greedy actions from the learnt policy. Plot should include the total reward per episode and. I want yout to implement one Q actor class, one train function and evaluate function. It's your choice to implement both train and evaluate as seperate funcs or you can implement a single function where I can toggle between both like saving weights and loading weights making the agent choose greedy actions. Part II - Solving Complex Environments In this part, test the Q actor-critic algorithm implemented in Part I on any other two complex environments.
-
Choose an environment. At least one of the environments has to be among "Suggested environments - Part II". Pick the easy environments among those suggested envs for part-II. The environment with multiple versions is considered as one environment.
-
Apply the Q actor-critic algorithm to solve it. You can adjust the neural network structure or hyperparameters from your base implementation.
-
Show and discuss your results after applying the Q actor-critic implementation on the environment. Plots should include the total reward per episode.
-
Provide the evaluation results. Run your environment for at least 10 episodes, where the agent chooses only greedy actions from the learnt policy. Plot should include the total reward per episode.
-
- Assistant
- User
Wonderful Work. I'm impressed by your work. I want you to fine-tune the hyperparameters and neural network architecture. Additionally, I want you to fully implement the Q-actor critic class to solve the more complex environments given below. Once again , pick two easiest one's from the following: • Any multi-agent environment • Lunar Lander • Car Racing • Bipedal Walker • MuJoCo Ant • Any Atari env. From my end, I'll implement code to plot the rewards and other performance metrics. Keep up the good work.
- Assistant
- User
Again, I'm impressed with your work. But for part-II , you've to pick the environments from the list given as: • Any multi-agent environment • Lunar Lander • Car Racing • Bipedal Walker • MuJoCo Ant • Any Atari env. But , you've picked the cartpole env which is what I'm expecting for part-II of our task. So, kindly revert the cartpole and choose another easy one from the list I've given in this text as your already chose lunar lander. Keep up the good work.
- Assistant
- User
I want to mention few key mistakes you made in the code. No.1 the train function and evaluate function you implemented is taking the device parameter we set to CUDA or CPU because of this I'm getting two devices error since my model is moved to GPU but my train is running on CPU . Make sure no such issues happen again.
- Assistant
- User
The three environments I've used are as follows: Cartpole-v1, Lunar Lander-v2 and BipedalWalker-v3. and I want you to write a report following NeurIPS template for the following questions . Based on how Q- actor critic works as per standards write the report. Here are the questions: 1. Discuss the Q Actor-critic algorithm you implemented. 2. What is the main difference between the actor-critic and value based approximation algorithms? 3. Briefly describe THREE environments that you used (e.g. possible actions, states, agent, goal, rewards, etc). You can reuse related parts from your Assignment 2 report. 4. Show and discuss your results after training your Actor-Critic agent on each environment. Plots should include the reward per episode for THREE environments. Compare how the same algorithm behaves on different environments while training. 5. Provide the evaluation results for each environments that you used. Run your environments for at least 10 episodes, where the agent chooses only greedy actions from the learnt policy. Plot should include the total reward per episode.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.