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

Update examples #2079

Merged
merged 60 commits into from
Aug 8, 2023
Merged

Update examples #2079

merged 60 commits into from
Aug 8, 2023

Conversation

Gamenot
Copy link
Collaborator

@Gamenot Gamenot commented Jul 6, 2023

This example can be run like this:

$ python examples/6_experiment_base.py +experiment=standard_lane_follower +env_config/scenarios=intersections episodes=2
Loading configuration from `/home/mtuck/repos/SMARTS/examples/configs/6_experiment_base`

# Current used configuration
# ==========================

episodes: 2
show_config: true
minimum_steps: 1
agent_configs:
  agent_j:
    locator: __main__:standard_lane_follower-v0
    max_episode_steps: 1000
  agent_k:
    locator: __main__:standard_lane_follower-v0
    max_episode_steps: 1000
env_config:
  id: smarts.env:hiway-v1
  scenarios:
  - ./scenarios/sumo/intersections/2lane
  - ./scenarios/sumo/intersections/2lane_circle
  - ./scenarios/sumo/intersections/4lane
  - ./scenarios/sumo/intersections/4lane_t
  - ./scenarios/sumo/intersections/6lane
  agent_interfaces: {}
  sim_name: null
  scenarios_order: scrambled
  headless: true
  visdom: false
  fixed_timestep_sec: 0.1
  sumo_options:
    num_external_clients: 0
    auto_start: true
    headless: true
    port: null
  seed: 42
  observation_options: multi_agent
  action_options: multi_agent
  environment_return_mode: per_agent

# ==========================
[2023-07-21 20:37:23,425][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/2lane/.
[2023-07-21 20:37:23,426][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/2lane_circle/.
[2023-07-21 20:37:23,428][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/4lane/.
[2023-07-21 20:37:23,430][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/4lane_t/.
[2023-07-21 20:37:23,431][smarts.sstudio.scenario_construction][INFO] - Building: ./scenarios/sumo/intersections/6lane/.
[2023-07-21 20:37:24,220][smarts.core.configuration][INFO] - Using engine configuration from: /home/mtuck/repos/SMARTS/smarts/engine.ini
╭────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────╮
│            Episode │     Sim T / Wall T │        Total Steps │        Steps / Sec │       Scenario Map │    Scenario Routes │     Mission (Hash) │             Scores │
├────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┤
│                1/2 │               3.86 │                 17 │              38.60 │       2lane_circle │                    │ 204454654383367451 │     6.85 - agent_k │
│                    │                    │                    │                    │                    │                    │                    │    41.65 - agent_j │
│                2/2 │               4.71 │                 16 │              47.12 │       2lane_circle │                    │ 204454654383367451 │    24.42 - agent_k │
│                    │                    │                    │                    │                    │                    │                    │    33.07 - agent_j │
╰────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────╯

I think this might require some experiment engineering but I have set up the basics for creating an experiment.

@Gamenot
Copy link
Collaborator Author

Gamenot commented Jul 11, 2023

The end understanding is that this will be implemented for experiments

@Gamenot Gamenot force-pushed the tucker/add_hydra_configured_example branch from 01b8c40 to bac6609 Compare July 11, 2023 13:33
@Gamenot Gamenot linked an issue Jul 11, 2023 that may be closed by this pull request
@Gamenot Gamenot force-pushed the tucker/add_hydra_configured_example branch from bac6609 to 8b0aca8 Compare July 11, 2023 18:11
Comment on lines +77 to +79
examples =
hydra-core
Copy link
Member

Choose a reason for hiding this comment

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

Need to update list of examples and instructions at SMARTS/docs and SMARTS/README.md files.

Copy link
Member

Choose a reason for hiding this comment

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

Can we move and merge these agents to SMARTS/zoo/policies ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I found importing SMARTS/zoo to be slightly complicated but it might be most reasonable to do that, leaving one local example to show how it works. Although, I am actually not sure how useful these primitives are generally, I would also like to have ML agents available for the base experiments.

Do we have any readily available?

Copy link
Member

Choose a reason for hiding this comment

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

I am planning to create one scl-zoo-installable ML zoo agent by simply creating a packaged agent from trained examples/RL/drive/inference code.

Copy link
Collaborator Author

@Gamenot Gamenot Jul 13, 2023

Choose a reason for hiding this comment

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

OK, I think that should go into this PR. Or into a mandatory follow-up.

@Gamenot Gamenot force-pushed the tucker/add_hydra_configured_example branch from f7f4b8d to b1e5f5a Compare July 21, 2023 20:41
@Gamenot Gamenot changed the title Add hydra configured example Update examples Jul 26, 2023
@Gamenot Gamenot force-pushed the tucker/add_hydra_configured_example branch from 0d19e83 to 95e90f5 Compare August 1, 2023 12:20
@Gamenot Gamenot force-pushed the tucker/add_hydra_configured_example branch from 990054a to 35bafda Compare August 8, 2023 13:34
@Gamenot Gamenot merged commit 9545528 into master Aug 8, 2023
25 checks passed
@Gamenot Gamenot deleted the tucker/add_hydra_configured_example branch August 8, 2023 14:27
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.

[Feature request] Simplified experiment configuration
2 participants