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

Question about Bridge observation tensor types. #1167

Closed
zizhang-qiu opened this issue Jan 18, 2024 · 5 comments
Closed

Question about Bridge observation tensor types. #1167

zizhang-qiu opened this issue Jan 18, 2024 · 5 comments
Labels
bug Something isn't working fixed This is fixed internally, and will be merged in the next github sync!

Comments

@zizhang-qiu
Copy link
Contributor

Hi, I read the code in bridge.cc and find the observation tensor only use three types ,

if (phase_ == Phase::kPlay) ptr[2] = 1;

ptr[phase_ == Phase::kPlay ? 1 : 0] = 1;

However, in bridge.h, four types of observation are declared.

inline constexpr int kNumObservationTypes = 4; // Bid, lead, declare, defend

@lanctot
Copy link
Collaborator

lanctot commented Jan 18, 2024

Hi, thanks. @elkhrt any ideas?

@elkhrt
Copy link
Member

elkhrt commented Jan 22, 2024

Yes, this looks like a bug - thanks for reporting it. Line 317 should be something like:

  const bool defending = (partnership != Partnership(contract_.declarer));
  if (phase_ == Phase::kPlay) ptr[2 + defending] = 1;

Do you fancy fixing it?

In general, we've only really used the bidding phase of the bridge implementation, so there may be some small issues with the play phase.

@zizhang-qiu
Copy link
Contributor Author

Thanks for the reply.
To be honest, I don't know how to fix it on github. Should I create a pull request or something? Are there any tutorials?

@elkhrt
Copy link
Member

elkhrt commented Jan 25, 2024

Yes, submit a pull request. You'll need to sign an contributor agreement also.
There's no OpenSpiel specific tutorial, but plenty of general ones!

@lanctot lanctot added bug Something isn't working fixed This is fixed internally, and will be merged in the next github sync! labels Feb 12, 2024
@lanctot
Copy link
Collaborator

lanctot commented Feb 12, 2024

Fixed by PR #1172 . Thanks @zizhang-qiu !

Commit here: 931e39a

@lanctot lanctot closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed This is fixed internally, and will be merged in the next github sync!
Projects
None yet
Development

No branches or pull requests

3 participants