ceem.systems package¶
Submodules¶
ceem.systems.discretelinear module¶
- 
class 
ceem.systems.discretelinear.DiscreteLinear(xdim, udim, ydim, A=None, B=None, C=None, D=None, obsModel={'activation': 'tanh', 'gain': 0.5, 'hidden_sizes': [32, 32], 'ln': False})[source]¶ Bases:
ceem.dynamics.DiscreteDynamicalSystem,torch.nn.modules.module.Module,ceem.dynamics.AnalyticDynJacMixin,ceem.dynamics.ObsJacMixinDiscrete dynamical system with linear dynamics and linear or non-linear observation model.
- 
jac_step_theta(t, x, u=None)[source]¶ Returns the Jacobian of step at time t
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_x_t (seq of torch.tensor): jacobian of the observation wrt each nn.Parameter
- 
jac_step_x(t, x, u)[source]¶ Returns the Jacobian of step at time t
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_x_t (torch.tensor): (B, T, n, n) shaped jacobian of the next state
- 
 
- 
class 
ceem.systems.discretelinear.DynamicsModule(A, B, xdim, udim)[source]¶ Bases:
torch.nn.modules.module.Module- 
forward(t, x, u)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- 
 
- 
class 
ceem.systems.discretelinear.ObservationModule(C, D, obsModel, xdim, udim, ydim)[source]¶ Bases:
torch.nn.modules.module.Module- 
forward(t, x, u)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- 
 
ceem.systems.lorenzattractor module¶
- 
class 
ceem.systems.lorenzattractor.LorenzAttractor(sigma, rho, beta, C, dt, method='midpoint')[source]¶ Bases:
ceem.dynamics.C2DSystem,torch.nn.modules.module.Module,ceem.dynamics.AnalyticObsJacMixin,ceem.dynamics.DynJacMixinBasic Lorenz Attractor
- 
jac_obs_theta(t, x, u)[source]¶ Returns the Jacobian of observation wrt theta
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (seq of torch.tensor): jacobian of the observation wrt each nn.Parameter
- 
jac_obs_x(t, x, u=None)[source]¶ Returns the Jacobian of observation wrt x
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (torch.tensor): (B, T, m, n) shaped jacobian of the observation
- 
 
ceem.systems.lorenzsystem module¶
- 
class 
ceem.systems.lorenzsystem.LorenzSystem(sigmas, rhos, betas, H, C, dt, method='midpoint')[source]¶ Bases:
ceem.dynamics.C2DSystem,torch.nn.modules.module.Module,ceem.dynamics.AnalyticObsJacMixin,ceem.dynamics.DynJacMixinBasic Lorenz Attractor
- 
jac_obs_theta(t, x, u=None)[source]¶ Returns the Jacobian of observation wrt theta
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (seq of torch.tensor): jacobian of the observation wrt each nn.Parameter
- 
jac_obs_x(t, x, u=None)[source]¶ Returns the Jacobian of observation wrt x
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (torch.tensor): (B, T, m, n) shaped jacobian of the observation
- 
 
ceem.systems.maglev module¶
- 
class 
ceem.systems.maglev.MagLev(mg, k, dt, method='midpoint')[source]¶ Bases:
ceem.dynamics.C2DSystem,torch.nn.modules.module.Module,ceem.dynamics.AnalyticObsJacMixin,ceem.dynamics.DynJacMixinSimple pendulum, where y = [cos th, sin th]
- 
jac_obs_x(t, x, u=None)[source]¶ Returns the Jacobian of observation wrt x
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (torch.tensor): (B, T, m, n) shaped jacobian of the observation
- 
 
ceem.systems.springmassdamper module¶
- 
class 
ceem.systems.springmassdamper.SpringMassDamper(M, D, K, dt, method='midpoint')[source]¶ Bases:
ceem.dynamics.KinoDynamicalSystem,ceem.dynamics.C2DSystem,torch.nn.modules.module.Module,ceem.dynamics.DynJacMixin,ceem.dynamics.AnalyticObsJacMixinGeneralized Spring Mass Damper System
- 
dynamics(t, q, v, u)[source]¶ Returns qdot_t
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
q (torch.tensor) – (B, T, qn) shaped system generalized coordinates
v (torch.tensor) – (B, T, vn) shaped system generalized velocities
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 (B, T, n) system gen. velocity derivatives
- Return type
 vdot (torch.tensor)
- 
jac_obs_theta(t, x, u)[source]¶ Returns the Jacobian of observation wrt theta
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (seq of torch.tensor): jacobian of the observation wrt each nn.Parameter
- 
jac_obs_x(t, x, u)[source]¶ Returns the Jacobian of observation wrt x
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
x (torch.tensor) – (B, T, n) shaped system states
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 jac_y_t (torch.tensor): (B, T, m, n) shaped jacobian of the observation
- 
kinematics(t, q, v, u)[source]¶ Returns qdot_t
- Parameters
 t (torch.tensor) – (B, T,) shaped time indices
q (torch.tensor) – (B, T, qn) shaped system generalized coordinates
v (torch.tensor) – (B, T, vn) shaped system generalized velocities
u (torch.tensor) – (B, T, m) shaped control inputs
- Returns
 (B, T, n) system gen. coordinate derivatives
- Return type
 qdot (torch.tensor)
-