Simulation Cache

A library to use precomputed simulation results for a fixed set of actions.

phyre.get_default_100k_cache(tier: str) → phyre.simulation_cache.SimulationCache

Get cache with results for simulation of 100k “default” actions.

class phyre.SimulationCache(cache_dir: Union[str, pathlib.Path])

Cache of simulation statuses for a subset of actions and tasks.

property action_array

Return an array of action with shape (cache_size, action_dim).

get_sample(task_ids: Optional[Sequence[str]] = None, num_actions: Optional[int] = None)

Samples cache for a set of actions on series of tasks.

Parameters
  • task_ids – List of tasks ids to sample form cache. Default None corresponds to all tasks in cache.

  • num_actions – Number of actions to sample per task. Default None corresponds to all actions in cache.

Returns

Dictionary

{
    'task_ids': array of task ids,
    'actions': array of size (num_actions, action space),
    'simulation_statuses': array of size (task_ids, num_actions) of
        simulation results from cache
}

Raises

ValueError – num_actions is greater than number of actions in cache.

load_simulation_states(task_id: str) → numpy.ndarray

Returns an array of simulation statuses as ints.

property task_ids

Returns a set of tasks in the cache.