Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RL intro documentation comment #202

Open
rbahumi opened this issue Jan 7, 2020 · 6 comments
Open

RL intro documentation comment #202

rbahumi opened this issue Jan 7, 2020 · 6 comments

Comments

@rbahumi
Copy link

@rbahumi rbahumi commented Jan 7, 2020

Hi,

Thanks for this great resource.

I have a comment regarding a statement in rl_intro.rst. Here is the relevant paragraph from the docs:

There is always an optimal policy which deterministically selects an action.

What about cases in which the optimal policy is stochastic like in rock-paper-scissors? In this case, there is no optimal deterministic policy, and also the optimal stochastic policy (choose an action at random) cannot be trivially learned with a value method algorithm.

@parvkpr
Copy link

@parvkpr parvkpr commented Jan 31, 2020

Hey @rbahumi,
You're right about the optimal stochastic policy bit. This is why "Exploration" is used in the field of reinforcement learning. As you might have noticed, In large scale problems there is some sort of exploration techniques incorporated based on the environment. They can be explicit(epsilon greedy policy which takes a random action with a probability of epsilon) or implicit (reward engineering).
Hope this clarified your issue.

@joshua-dean
Copy link

@joshua-dean joshua-dean commented Feb 10, 2020

Considering the rock-paper-scissors case, is a random action any better than choosing a single action repeatedly?
Assuming the environment will act randomly in an evenly distributed fashion and any observation given to a policy is meaningless, choosing the same action every time in a deterministic manner will yield a 1/3 success rate, the same as randomly choosing an action.
If the environment gives a nontrivial observation or the proportion of the opponent's selection is not even, that can be learned to produce a deterministic policy that can outperform a random one.
So unless I'm missing something about this, there's no case where the above statement isn't true, as for any even distribution a single decision is optimal, and uneven distributions can be exploited still utilizing determinism.

Additionally, if I recall correctly any non-deterministic algorithm can be simulated by a deterministic one.

@rbahumi
Copy link
Author

@rbahumi rbahumi commented Feb 11, 2020

Considering the rock-paper-scissors case, is a random action any better than choosing a single action repeatedly?
Assuming the environment will act randomly in an evenly distributed fashion and any observation given to a policy is meaningless, choosing the same action every time in a deterministic manner will yield a 1/3 success rate, the same as randomly choosing an action.
If the environment gives a nontrivial observation or the proportion of the opponent's selection is not even, that can be learned to produce a deterministic policy that can outperform a random one.
So unless I'm missing something about this, there's no case where the above statement isn't true, as for any even distribution a single decision is optimal, and uneven distributions can be exploited still utilizing determinism.

Additionally, if I recall correctly any non-deterministic algorithm can be simulated by a deterministic one.

@Alder85 when I was talking about rock-paper-scissors I meant in a game against an intelligent opponent that tries to maximize the reward and dynamically changes its policy. In this case, if one of the players chooses to play anything except choosing an action randomly with probability 1/3, the second player will exploit that. Playing 1/3 is the Nash equilibrium of this game.

@rbahumi
Copy link
Author

@rbahumi rbahumi commented Feb 11, 2020

Hey @rbahumi,
You're right about the optimal stochastic policy bit. This is why "Exploration" is used in the field of reinforcement learning. As you might have noticed, In large scale problems there is some sort of exploration techniques incorporated based on the environment. They can be explicit(epsilon greedy policy which takes a random action with a probability of epsilon) or implicit (reward engineering).
Hope this clarified your issue.

@parvkpr exploration is not relevant in this case. Exploration is used to explore and find the optimal policy. In the case of rock-paper-scissors the optimal policy is known to be stochastic and this is something a value function cannot learn.
In action-value methods, the policy is set implicitly by choosing the action with the maximal action value estimate. This inherent maximization makes it impossible for action-value methods to naturally learn a distribution over actions.

@joshua-dean
Copy link

@joshua-dean joshua-dean commented Feb 11, 2020

@rbahumi I didn't fully consider that case.
Given that the opponent adapts in a random or nonrandom fashion, and only provides trivial observations, it does make sense that a basic policy could not learn the optimal strategy.
However, and I'm not completely sure on this: wouldn't an actor that considers the history of it's own actions (such as an RNN or LSTM) still be able to achieve optimal performance in this case?
If the opponent adapts in a random fashion, the desired output would be an approximately even distribution across actions, which given a sufficiently large memory of previous actions is something that a deterministic policy should still be capable of.
In the case that the opponent adapts in a non-random fashion (meaning there is any way at all to model how the opponent will adapt from given information), a deterministic policy can learn this and then outperform an even stochastic distribution.
I'm willing to believe that for the first case to be optimal the memory size for some problems may have to approach infinity (although for most use cases a sufficiently large finite amount is probably 'good enough'), but unless I'm missing something I still think an optimal deterministic policy is technically achievable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
@rbahumi @joshua-dean @parvkpr and others
You can’t perform that action at this time.