Open nokados opened 3 years ago
Oops. I haven't seen a homework suggesting fixing this when I wrote the issue. Probably we should delete this...
I'm not sure I understand which homework you are referring to where you say that it suggests to fix this issue. The next homework is deep CEM, which differs only by the environment (MountainCar instead of Taxi) and the estimator (a neural network instead of a table). We don't expect any changes for the learning algorithm there. In week 2 and onwards, we move on to more complex algorithms, none of which are a generalization of CEM.
However, I don't think that investing any effort into tuning the CEM assignment is worthwhile. It only serves the function of demonstrating that an extremely primitive algorithm can solve RL problems, but its performance is weak compared to Q-learning or any other "true RL" algorithms.
In the seminar of week 1, there is a problem: optimization goes up to around -50. You propose the next workaround:
I think this will not work. In the video, you compare this problem with a "bandit" that gives you a reward randomly. It is not the Taxi task case, because, despite the random start state, your reward is defined by state and action. So I do not see the point to fix action for a starting point.
I propose a different solution. I agree that in case CEM failed to learn how to win from one distinct starting point, it will simply discard it because no sessions from that starting point will make it into the "elites". So let's take samples from each point into elite samples. To do this, we just calculate the percentile for each state independently instead of a single total percentile.
So, select_elites will look like this:
I have also increased n_sessions to 500 to have more samples per state.
As a result, the task converges to a positive score of around 5.