neuromancer.dynamics package
Submodules
neuromancer.dynamics.integrators module
Single-step integrators for first-order nonautomonomous ODEs
- class neuromancer.dynamics.integrators.DiffEqIntegrator(block, interp_u=None, h=0.001, method='euler')[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.Euler(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.Euler_Trap(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.Integrator(block, interp_u=None, h=1.0)[source]
Bases:
Module
,ABC
- class neuromancer.dynamics.integrators.LeapFrog(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.Luther(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.MultiStep_PredictorCorrector(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.RK2(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.RK4(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
- class neuromancer.dynamics.integrators.RK4_Trap(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
predictor-corrector integrator for dx = f(x) predictor: explicit RK4 corrector: implicit trapezoidal rule
- class neuromancer.dynamics.integrators.Runge_Kutta_Fehlberg(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
The Runge–Kutta–Fehlberg method has two methods of orders 5 and 4. Therefore, we can calculate the local truncation error to determine if current time step size is suitable or not. # https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods#Adaptive_Runge%E2%80%93Kutta_methods
- class neuromancer.dynamics.integrators.Yoshida4(block, interp_u=None, h=1.0)[source]
Bases:
Integrator
neuromancer.dynamics.interpolation module
- class neuromancer.dynamics.interpolation.LinInterp_Offline(t, u)[source]
Bases:
Interpolation
- class neuromancer.dynamics.interpolation.LinInterp_Online[source]
Bases:
Interpolation
neuromancer.dynamics.ode module
- class neuromancer.dynamics.ode.BrusselatorHybrid(block, insize=2, outsize=2)[source]
Bases:
ODESystem
- class neuromancer.dynamics.ode.GeneralNetworkedODE(map=None, agents=None, couplings=None, insize=None, outsize=None, inductive_bias='additive')[source]
Bases:
ODESystem
Coupled nonlinear dynamical system with heterogeneous agents. This class acts as an aggregator for multiple interacting physics that contribute to the dynamics of one or more agents.
- coupling_physics(x, *args)[source]
This coupling physics assumes that each coupling physics nn.Module contains the connection information, including what agents are connected and if the connection is symmetric.
- class neuromancer.dynamics.ode.LotkaVolterraHybrid(block, insize=2, outsize=2)[source]
Bases:
ODESystem
- class neuromancer.dynamics.ode.ODESystem(insize, outsize)[source]
Bases:
Module
,ABC
Class for defining RHS of arbitrary ODE functions, can be mix-and-matched according to expert knowledge.
- forward(x, *args)[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
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class neuromancer.dynamics.ode.SSM(fx, fu, nx, nu, fd=None, nd=0)[source]
Bases:
Module
Baseline class for (neural) state space model (SSM) Implements discrete-time dynamical system:
x_k+1 = fx(x_k) + fu(u_k) + fd(d_k)
- with variables:
x_k - states u_k - control inputs d_k - disturbances
neuromancer.dynamics.physics module
- class neuromancer.dynamics.physics.Agent(state_names)[source]
Bases:
Module
,ABC
An agent is an object in a networked or otherwise distributed system that can: - have some intrinsic physics - serve as anchor for connections (pins)
- forward(x)[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
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class neuromancer.dynamics.physics.DeltaTemp(R=Parameter containing: tensor(1., requires_grad=True), feature_name='T', symmetric=False, pins=[])[source]
Bases:
Interaction
Interaction physics for difference in temperature (assumed) between agents.
- class neuromancer.dynamics.physics.DeltaTempSwitch(R=Parameter containing: tensor([1.], requires_grad=True), feature_name='T', symmetric=False, pins=[])[source]
Bases:
Interaction
Interaction physics for difference in temperature (assumed) between agents. Switched on/off depending on agent values (zero or nonzero).
- class neuromancer.dynamics.physics.HVACConnection(feature_name='T', symmetric=False, pins=[])[source]
Bases:
Interaction
Imposition of a source term as an interaction.
- class neuromancer.dynamics.physics.Interaction(feature_name, pins, symmetric)[source]
Bases:
Module
,ABC
An interaction is a physical connection between agents: - interactions are pairwise - interactions can be one-sided or symmetric (influence both agents)
- forward(x)[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
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- class neuromancer.dynamics.physics.RCNode(C=Parameter containing: tensor([1.], requires_grad=True), state_names=['T'], scaling=1.0)[source]
Bases:
Agent
RCNode agent. The intrinsic action of the agent is to effectively scale the interaction physics according to the capacitance of the agent. Examples include lumped volumes, rooms, etc.