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

Object shuffling feature #4

Open
laetitia-teo opened this issue May 25, 2022 · 2 comments
Open

Object shuffling feature #4

laetitia-teo opened this issue May 25, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@laetitia-teo
Copy link

Hi !

I am currently performing experiments where the agent has to go seek objects that are named at the beginning of an episode. I would be very interested in having options for generating environment variations while ensuring that named objects are present in a given environment. Is it possible to have an API call for shuffling objects around based on a given environment state ?

@PeterAJansen
Copy link
Collaborator

Thanks for this request!

In the initial build of ScienceWorld, every instance of the environment was randomly generated (so there was no way of guaranteeing generating the same environment). When we changed it to make the environments deterministic, I did that essentially by feeding a reference to a random number generator into the environment builder, and then progressively weeding out anything that wasn't deterministic until the gold agents (used as tests) achieved 100% performance. That means the way the environment generation is architected right now, it'd be easy to generate additional versions of the environment that have different distractors, but keeping the same distractors in different locations would take a bit of refactoring.

Just to confirm: Say for a given task variation (say, task: pick the shortest-lived animal, where the task-objects generated for that variation are bee, rabbit, and turtle, and the environment happened to populate some other specific distractor objects: e.g. an apple in a bowl in the kitchen, and a painting on the wall in the kitchen) -- is what you're looking for to keep everything the same (task objects, and those specific distractor objects), just having the distractor objects in different locations? Or is generating different distractor objects/environment variations OK, as long as the task objects are identical? (the latter is likely much easier the way things are currently architected).

@MarcCote MarcCote added the enhancement New feature or request label May 28, 2022
@laetitia-teo
Copy link
Author

Hi !

Thanks for the detailed explanations ! The feature I am looking for is keeping the exact same objects from one scene to the other, just to have their positions randomized (so an apple in the bowl in the kitchen could be in the table in the garden for instance). This would apply to distractors and task objects (my agent actually samples its own objective from objectives it has already accomplished, to the distractor/task object distinction is not relevant to the agent a priori). This feature would make sure that the objective the agent sets itself is feasible in the environment.

So the API call could look something like this:

env = ScienceWorldEnv()
env.reset_with_variation(0)
... # agent collects experience
goal = agent.sample_goal()
env.shuffle_objects_around(seed)  # <-- this is what I would ideally need
...  # agent tries to perform goal

Previous work on similar agents make sure the environment contains the object after the agent samples a new goal, so the following could also work:

goal = agent.sample_goal()  # goal describes an object
env.reset_from_goal(goal)  # object is present in the environment variation

Thanks again for the answer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants