-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: add-baseline-advisors
Are you sure you want to change the base?
Conversation
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/`.
Miscellaneous improvements
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.
Implement JSON-based suggestion API
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`.
There was a problem hiding this 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 thelogging
module inbaseline_models
. That will make debugging easier because we uselogging
in the bots, and mixingprint()
andlogging
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.
- You should include a link to https://unisydneyedu-my.sharepoint.com/:f:/g/personal/nhad0493_uni_sydney_edu_au/EpvBJyx08X1HvnluND6tZAYBe2Fvoiz2GjVEM7Q_NpsAkg in the README. You might also want to consider uploading the models to the CHIRON Google Drive so people can access it more easily.
- This is a very minor concern, but it's confusing that the models are named using DDMMYYYY. If you use YYYYMMDD, then sorting the file names alphabetically would also sort them by date. You might want to consider renaming them.
- 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.
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. Let me know if there are any more changes to be made! |
Add support for predicting opponent orders
Co-authored-by: Alex Hedges <git@alexhedges.dev>
This commit contains some changes that are *probably* a good idea, but I'm not confident enough in them to include them in the previous commit.
…chiron-utils into add-baseline-advisors
…IP/chiron-utils into add-baseline-advisors-lr
No description provided.