-
Notifications
You must be signed in to change notification settings - Fork 159
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
Trajectory visualization #38
Trajectory visualization #38
Conversation
Hi Bartek, thanks for you PR! Just as a quick note, it would generally be useful if you add an example usage of the new functionality you introduce in your PRs descriptions (if it's not obvious), and in the case of visualizations also add an example jpeg! In any case, I do think that it seems to me like many of the changes here are not necessarily compatible in philosophy with the updated repo, so we might just want to leave these changed pending and not merge this PR (I'm sure at a later time, some of this code could be salvaged). In particular, we have now moved to a purely-python implementation of Also, not sure if you saw that this branch is out-of-date with the base branch, so in any case it would require updating before it would even be possible to merge. |
I think both pure python and python+js approaches for visualizations are ok depending on the interactivity level we want to have. Pros of having charts in js runnable from python:
Cons of having charts in js:
Additional questions:
|
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.
Hi Bartek,
Sorry for the long delay. In general I really like your code! Very well documented and easy to follow with lots of intuitive helper functions. That helps A LOT and makes this whole process easier for everyone involved so thanks!
As far as the dependency on JS code, I think that's actually ok in this case, despite the consistent effort to migrate entirely to python. I will note however, that any JS code you write should be done sparingly and with caution, with the following requisites:
- Able to be easily invoked from a python function
- Able to easily return any data/computation/results back to the python function
- Does the absolute bare minimum of pre-processing/processing. This one is the most important; there should be absolutely ZERO overcooked logic in any JS code
However, it does appear that your code here abides by all of these constraints, so I think it would be ok to incorporate it. Going forward, however, I highly recommend using JS only as a last resort, only after convincing yourself its infeasible to do it natively in python.
…ctory_visualization_merged
…ile, add potting and delivery event support
… graphs in single notebook)
… every object, add events_list field in trajectory
I've done it using method ids_independent_equal to not rely on identical order of calling RNG with the exact same seed at the start. There are some things that can be done to prevent randomness like setting random state in game state. After finishing coding I think that saving rng state approach would be probably a bit better but given that the current solution is already done and works I will leave it as it is. |
"- serving location - 'S'\n", | ||
"- player starting location - number \n", | ||
" \n", | ||
"You can save layout in ovecooked_ai/overcooked_ai_py/data/layouts directory and then run agent evaluator AgentEvaluator({\"layout_name\": layout_name}) where layout_name is filename without \".layoyut extension\". \n", |
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.
This notebook is not up to date with master branch. Probably needs some refinement before merging this file to master - see comment about possible changes in #48 issue
Moving this PR to draft because soon I will change the chart code to add support of adjectives, delivery events, etc. |
…g .py files - without it -e flag is mandatory while doing pip install
…sage\n- add adjectives usage\n- add proper visualization of potting and deliveries\n- add custom cumulative line support
…erge of this pr and native python visualizations
I've added new functionalities and did a bit of refactoring.
|
requested changes are already done (tests) or irrelevant (canvas version change)
…rt where rendering chart function is declared (to use in overcooked-demo)
I've split the event_chart.js file into 2 parts: render_events_chart function (used in both overcooked_demo and this PR) and script to rune render_events_chart from python (template with variables that are sent from python code). |
Given that this is a lower priority issue right now, I'll temporarily close this PR for bookeeping – we can re-open it in the future if we are interested in exploring this direction further. |
Changes are mostly for method events_visualization in AgentEvaluator from overcooked_ai_py/agent/benchmarking.py
Example look:
More on chart settings and the way defaults are updated:
Example usage looks mostly like that:
There is also small tutorial notebook I wrote: overcooked_ai/overcooked_ai_py/tutorial_notebooks/Agent_evaluator_intoduction.ipynb .
Some of the things I'm not sure about: