swmpo

SWMPO

Documentation

Structured World Modelling for Policy Optimization* (SWMPO) is a framework for continuous hybrid modeling dynamical systems with neurosymbolic Finite State Machines.

API

There are two main aspects:

  • Mode identification: partitions a dataset of trajectories into 'modes', where each mode has a local model of the dynamics ('primitive').
  • FSM synthesis: leverages a partition and a set of trajectories to synthesize a Finite State Machine (FSM).

Mode identification

The mode identification step consists of (1) partioning a dataset of trajectories and (2) training a forward model ('primitive') on each resulting subset.

Each primitive is a function of the form (observation, action) -> next observation. That is, each primitive is an approximation of the transition function of the environment for a subset of the state space.

Partitioning a dataset is implemented in swmpo.partition.get_partition.

FSMs

Turning a partition into a state machine is implemented in swmpo.state_machine.get_partition_induced_state_machine.

Given an observation, an action and an active state an FSM in SWMPO can answer two questions:

  • What will the next observation be?
  • To which state should the FSM transition to?

These computations are implemented in swmpo.state_machine.state_machine_model.

1"""
2.. include:: ../README.md
3"""