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

Different rewards for O and X? #5

Open
drozzy opened this issue Mar 6, 2020 · 2 comments
Open

Different rewards for O and X? #5

drozzy opened this issue Mar 6, 2020 · 2 comments

Comments

@drozzy
Copy link

drozzy commented Mar 6, 2020

Sorry if this is a dumb question but here you set different rewards based on whether X wins or O wins:
https://github.com/haje01/gym-tictactoe/blob/master/gym_tictactoe/env.py#L8

Why is that?

If X's reward for winning is -1, wouldn't that encourage an agent that is playing for X to always loose?

Thanks.

@haje01
Copy link
Owner

haje01 commented Mar 7, 2020

Please consider the code below:

# select most right action for 'O' or 'X'
if self.mark == 'O':
indices = best_val_indices(ava_values, max)
else:
indices = best_val_indices(ava_values, min)

@drozzy
Copy link
Author

drozzy commented Mar 7, 2020

Ah, I see.
But if I wanted to apply a ready-made algorithm, I suppose I should make the rewards positive, and just assign the "-ve" reward to the looser.

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

No branches or pull requests

2 participants