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

Model game input #37

Open
PhilipEkfeldt opened this issue Jun 28, 2020 · 3 comments
Open

Model game input #37

PhilipEkfeldt opened this issue Jun 28, 2020 · 3 comments
Assignees

Comments

@PhilipEkfeldt
Copy link
Contributor

Currently the model (PhilipNet) needs a game instance as input to get the width/height of the board. I think it's preferable to have width/height as arguments instead, to not have to initialize a game instance every time you want to create a model just to access the width/height, or some other solution. Any thoughts @abhon @charlesoblack ?

@guidopetri
Copy link
Contributor

In principle, I agree; however, the width/height need to somehow be bound to a Game instance since we otherwise could create the model with different width/height dimensions than the Game itself.

It's also not necessarily always the same for a given game - we could for instance play connect4 with dimensions of 7x9, or 7x5, or whatever like that. If it were the same for a given game, then we could just move it to be a staticmethod / class property, but unfortunately if we want the flexibility we can't do that.

If you have any workarounds for this it would be great though, because I agree - instantiating a Game just to pass into the model (and then never be used again) seems silly.

@homerours
Copy link
Contributor

I agree too. A possible workaround would be to use a dictionnary game_params containing:

  • the width / height
  • the shape of the policy head.
    For tictactoe, the policy head has the same dimension than the game itselt, but not for Connect4, where it is just the number of columns.
    Then game_params is given as input to PhilipNet and to Connect4/TicTacToe.

@PhilipEkfeldt
Copy link
Contributor Author

I agree too. A possible workaround would be to use a dictionnary game_params containing:

  • the width / height
  • the shape of the policy head.
    For tictactoe, the policy head has the same dimension than the game itselt, but not for Connect4, where it is just the number of columns.
    Then game_params is given as input to PhilipNet and to Connect4/TicTacToe.

I think this is a good solution, I can update this

@PhilipEkfeldt PhilipEkfeldt self-assigned this Jul 9, 2020
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

3 participants