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

Add baseline advisor for lr model #19

Open
wants to merge 45 commits into
base: add-baseline-advisors
Choose a base branch
from

Conversation

gale2307
Copy link
Collaborator

No description provided.

aphedges and others added 14 commits November 19, 2024 16:14
Only the version from `typing` is subscriptable before Python 3.9. We
need to support back to Python 3.7, so we must import that version.
We should try to catch compatibility issues with Python 3.7 *before* we
try to run CICERO.
Fix compatibility with Python 3.7
Generated automatically by the following commands:

```
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt
make lock
```
Now that I am using an Apple silicon laptop, Docker defaults to building
images for ARM. This image will always need to run on an x86_64 server,
so we should explicitly set the architecture for builds.
The separate `log/` directory was created before I started using
top-level `data/` directories in projects, and there is no need to keep
it separate. Moving it into `data/` makes the repository easier to work
with, which includes allowing cleaner `git clean` output.
I removed orchestration support for Apptainer and Singularity a while
ago, so there is no need to ignore their files anymore. If anyone wants
to use them, they can just store them in `data/`.
A JSON-based format is easier to work with than our old ad-hoc message
format, and it will make future format changes *much* easier to
implement.

I already implemented this new format in `diplomacy`, and I have tested
this commit for both `RandomProposerAdvisor` and the CICERO advisor.
@gale2307 gale2307 requested a review from aphedges December 10, 2024 23:58
gale2307 and others added 13 commits December 11, 2024 11:37
I accidentally used overly strict typing when I created this method.
When I copied `suggest_message()` to create `suggest_commentary()`, I
forgot to change the reference to the original function's name in the
error message.
This further abstracts away the message format of suggestions and makes
a later change easier.
The first JSON format was designed to allow easy filtering by the
intended recipient, but it assumed that a player would only receive
advice about themselves. It was unable to handle move advice about other
players, which we intend to support, so I needed to redesign the format
to allow it.

The new format has an explicit `recipient` field to avoid accidentally
intercepting any suggestions intended for another player. In addition,
it can handle other top-level metadata that we want to store, such as
the advisor that sent the suggestion.
Although the player will not see this value, we want this available in
the logs for evaluation.
This will be used by CICERO to send predicted orders to the Llama
advisor.
All bots should declare what suggestion types they support in
`BaselineBot.suggestion_type`, and that value is needed so the UI
displays the sent suggestions.

We should raise an exception to prevent a bot from accidentally sending
suggestions that the user would never see when the suggestion support is
not explicitly declared.
We now test the new `BaselineBot.suggest_opponent_orders()` method in
`RandomProposerAdvisor`.
Copy link
Contributor

@aphedges aphedges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long to get back to you, but I needed to get some other stuff done first.

The good news is that I was able to run your bot and generate advice using it! No major changes are needed.

Here is some general feedback:

  • Please switch from using print() to using the logging module in baseline_models. That will make debugging easier because we use logging in the bots, and mixing print() and logging can cause output to be out of order.
  • Add a description of how to download the models and how to run the bots in the "Bots" section of the README.
  • Does KnnBot run at all? If so, where should I get the model? If not, it should just be deleted.
  • Run make check in the repository and fix the problems it finds. This appears to mostly be improving the docstrings.

@gale2307 gale2307 requested a review from aphedges December 17, 2024 06:03
@gale2307
Copy link
Collaborator Author

Hi Alex, thank you for the feedback!

I updated the docstrings and readme. We're not using the KNN bot anymore, so I deleted it.
make check runs without errors as well.
I'll be working on changing print with logging in baseline_models, it should be done by sometime this week.

Let me know if there are any more changes to be made!

@gale2307 gale2307 requested a review from YanzeJeremy December 17, 2024 23:34
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

Successfully merging this pull request may close these issues.

3 participants