MCPcopy Create free account

hub / github.com/StanfordASL/neural-network-lyapunov / functions

Functions1,470 in github.com/StanfordASL/neural-network-lyapunov

↓ 3 callersMethodconstruct_relu_second_order_forward_system_given_equilibrium
( self, q_equilibrium, u_equilibrium, dt)
neural_network_lyapunov/test/test_feedback_system.py:285
↓ 3 callersMethodconstruct_relu_system_example
(self, discrete_time_flag)
neural_network_lyapunov/test/test_relu_system.py:400
↓ 3 callersMethodconstruct_relu_system_example
(self)
neural_network_lyapunov/test/test_relu_system.py:514
↓ 3 callersMethodconstruct_strengthened_mip
(self, c, w, b, lo, up, relu_input_lo, relu_input_up, use_binary, selective
neural_network_lyapunov/test/test_mip_utils.py:485
↓ 3 callersFunctioncontroller
(x)
neural_network_lyapunov/examples/pendulum/train_pendulum_demo.py:135
↓ 3 callersFunctioncreate_mip
(lyap, x_equilibrium, V_lambda, V_epsilon, R_options, positivity_flag, eps_type, controller_par
neural_network_lyapunov/test/feedback_gradient_check.py:154
↓ 3 callersFunctionextract_relu_structure
Get the linear_layer_width, negative_slope and bias flag.
neural_network_lyapunov/utils.py:1053
↓ 3 callersMethodgenerate_dataset
generates a dataset using pybullet @param x_lo, x_up, bounding box on the initial states of the system @param dt float time s
neural_network_lyapunov/pybullet_data_generation.py:301
↓ 3 callersMethodget_active_constraint_indices_and_binary_val
Given the MIP is solved to optimality, get the indices of the active constraints. @param solution_number The index of the sub
neural_network_lyapunov/gurobi_torch_mip.py:929
↓ 3 callersMethodlinearized_dynamics
(self, x, u)
neural_network_lyapunov/examples/rocket/rocket.py:44
↓ 3 callersMethodlinearized_dynamics
Return ∂ẋ/∂x and ∂ẋ/∂ u
neural_network_lyapunov/examples/quadrotor2d/quadrotor_2d.py:44
↓ 3 callersMethodlqr_control
The control action should be u = K * (x - x*) + u*
neural_network_lyapunov/examples/quadrotor2d/quadrotor_2d.py:83
↓ 3 callersMethodlyapunov_derivative_as_milp_tester
(self, system, x_equilibrium, x_samples, eps_type, R)
neural_network_lyapunov/test/test_lyapunov.py:1162
↓ 3 callersMethodlyapunov_derivative_loss_at_sample_tester
(self, dut, R, training_params,
neural_network_lyapunov/test/test_train_feedback_system.py:277
↓ 3 callersMethodnext_pose
Computes the next pose of the car after dt.
neural_network_lyapunov/examples/car/unicycle.py:61
↓ 3 callersMethodpossible_dx
For state/control on the boundary of two modes, we regard that both modes are possible (because in numerical optimization we can't im
neural_network_lyapunov/hybrid_linear_system.py:348
↓ 3 callersMethodreconstruction_loss
computes the reconstruction loss using either L2 loss or binary cross entropy @param x tensor label @param x_decoded
neural_network_lyapunov/dynamics_learning.py:771
↓ 3 callersFunctionreplace_binary_continuous_product
We replace the product between a binary variable α and a continuous variable x by a slack variable s, such that s = α * x. To impose this
neural_network_lyapunov/utils.py:38
↓ 3 callersMethodrollout_validation
computes the mean loss along a list of rollouts @param rollouts list of tensors, each one of them a rollout @param device whe
neural_network_lyapunov/dynamics_learning.py:367
↓ 3 callersMethodsample_state
(self, system, mode=None)
neural_network_lyapunov/test/test_lyapunov.py:1136
↓ 3 callersMethodset_variable_value
(self, R_val: np.ndarray)
neural_network_lyapunov/r_options.py:169
↓ 3 callersMethodset_variable_value_directly
(self, variable_val: np.ndarray)
neural_network_lyapunov/r_options.py:75
↓ 3 callersMethodset_variable_value_directly
(self, variable_val: np.ndarray)
neural_network_lyapunov/r_options.py:238
↓ 3 callersFunctionsetup_relu
(relu_layer_width, params=None, negative_gradient=0.1, bias=True)
neural_network_lyapunov/test/train_discrete_linear_system_toy_lyapunov.py:20
↓ 3 callersMethodsolve_boundary_gap_mip
Solve the problem max_x V(x) − min_y V(y) s.t x∈∂ℬ, y∈∂ℬ where ℬ is the verified region (a box by default).
neural_network_lyapunov/train_lyapunov_barrier.py:470
↓ 3 callersMethodsolve_lyap_derivative_mip
(self)
neural_network_lyapunov/train_lyapunov_barrier.py:373
↓ 3 callersMethodsolve_positivity_mip
(self)
neural_network_lyapunov/train_lyapunov_barrier.py:324
↓ 3 callersMethodstance_phase_energy
Compute the total kinematic + potential energy for a stance phase state.
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:135
↓ 3 callersMethodstep_forward
(self, x_start, u_start)
neural_network_lyapunov/examples/quadrotor2d/quadrotor_2d.py:211
↓ 3 callersFunctionstrengthen_relu_mip_w_indices
We strengthen the big-M formulation of the leaky ReLU unit y = max(c*wᵀx+b, wᵀx+b), lo <= x <= up with the constraint y <= bc + b(1-c
neural_network_lyapunov/mip_utils.py:11
↓ 3 callersFunctiontake_maximum
(tensor1, tensor2)
neural_network_lyapunov/gurobi_torch_mip.py:292
↓ 3 callersFunctiontake_minimum
(tensor1, tensor2)
neural_network_lyapunov/gurobi_torch_mip.py:301
↓ 3 callersFunctiontest_project_gradient
(relu, loss1, loss2, mode)
neural_network_lyapunov/test/test_train_utils.py:45
↓ 3 callersFunctiontrain_controller_approximator
(controller_relu, states, controls, lambda_u, Ru, num_epochs, lr)
neural_network_lyapunov/examples/car/train_unicycle_demo.py:111
↓ 3 callersFunctiontrain_cost_approximator
(lyapunov_relu, V_lambda, R, states, costs, num_epochs, lr)
neural_network_lyapunov/examples/car/train_unicycle_demo.py:134
↓ 3 callersMethodtrain_with_cost_to_go
Similar to train() function, but with given samples on initial_state and cost-to-go.
neural_network_lyapunov/train_lyapunov_barrier.py:1377
↓ 3 callersMethodupdate_parent
updates the parent of node[node_idx] to parent_idx.
neural_network_lyapunov/examples/car/rrt_star.py:149
↓ 3 callersMethodvalue_as_milp
To compute the maximal violation of the constraint that h(x) is negative in the unsafe region, or positive in the safe region, we
neural_network_lyapunov/barrier.py:70
↓ 2 callersMethodR
(self)
neural_network_lyapunov/r_options.py:81
↓ 2 callersMethodR
(self)
neural_network_lyapunov/r_options.py:184
↓ 2 callersMethod__compute_gigammai_bounds
Compute the element-wise bounds on gᵢγᵢ return (gigammai_lower, gigammai_upper) gigammai_lower[i]/gigammai_upper[i] is the lo
neural_network_lyapunov/continuous_time_lyapunov.py:420
↓ 2 callersMethod__init__
@param model A ReLU network.
neural_network_lyapunov/relu_to_optimization.py:252
↓ 2 callersMethod__init__
(self, dtype)
neural_network_lyapunov/gurobi_torch_mip.py:376
↓ 2 callersMethod__init__
(self, A: torch.Tensor, B: torch.Tensor, x_lo: torch.Tensor, x_up: torch.Tensor, u_lo: torch.
neural_network_lyapunov/control_affine_system.py:111
↓ 2 callersMethod__init__
Helper class to train dynamics using lyapunov regularization @param train_dataloader torch Dataloader for training @param val
neural_network_lyapunov/dynamics_learning.py:36
↓ 2 callersMethod__init__
(self, plant)
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py:65
↓ 2 callersMethod__init__
(self, act_low, act_high, obs_equ, act_equ, hidden_sizes, activation)
neural_network_lyapunov/examples/rl/td3.py:36
↓ 2 callersFunction_add_constraint_by_neuron
This function adds the constraint on zᵢ₊₁(j) = leaky_relu((Wᵢzᵢ+bᵢ)(j)) between zᵢ₊₁(j), zᵢ, and the (binary) slack variables.
neural_network_lyapunov/relu_to_optimization_utils.py:9
↓ 2 callersMethod_add_dl1dx_times_xdot
(self, V_lambda, R, l1_binary, system_constraint_return, milp, xdot)
neural_network_lyapunov/continuous_time_lyapunov.py:191
↓ 2 callersFunction_add_input_saturation_constraint
Add the MIP constraints of the saturation block. Also output the bounds of u after the saturation.
neural_network_lyapunov/feedback_system.py:478
↓ 2 callersMethod_add_linear_controller_mip_constraint
(self, mip, x_var, u_var, binary_var_type)
neural_network_lyapunov/feedback_system.py:221
↓ 2 callersMethod_add_network_controller_mip_constraint_given_relu_bound
( self, prog, x_var, u_var, controller_pre_relu_lo, controller_pre_relu_up, network_in
neural_network_lyapunov/feedback_system.py:109
↓ 2 callersMethod_add_node_with_path
Add a node with the path (x, u, dt) from this node to the parent.
neural_network_lyapunov/examples/car/rrt_star.py:41
↓ 2 callersFunction_cluster_adversarial_states
The adversarial states generated from Gurobi often have clusters (some adversarial states are very close to each other). We select only one
neural_network_lyapunov/train_lyapunov_barrier.py:1453
↓ 2 callersMethod_compute_Wz_bounds_optimization
This function is used in output_gradient_times_vector. It computes the lower/upper bounds of Wᵢ*z through optimization, where zᵢ is
neural_network_lyapunov/relu_to_optimization.py:1210
↓ 2 callersMethod_get_current_training_params
Return the parameters (weights/bias etc) of the current model.
neural_network_lyapunov/train_lyapunov_barrier.py:1107
↓ 2 callersMethod_lyapunov_gradient_batch
Compute the gradient ∂V/∂x. This function assumes x is a batch of state. When there are multiple possible subgradients, we ta
neural_network_lyapunov/lyapunov.py:507
↓ 2 callersMethod_lyapunov_value_as_milp
For an MILP, add the constraints such that we can compute V(x) = V_coeff * V_vars + V_constant Return: V_coeff, V_
neural_network_lyapunov/lyapunov.py:188
↓ 2 callersFunction_to_tensor
(x)
neural_network_lyapunov/test/feedback_gradient_check.py:371
↓ 2 callersMethodact
(self, obs)
neural_network_lyapunov/examples/rl/td3.py:80
↓ 2 callersMethodadd_continuity_constraint
Add the continuity constraint (8) in the documentation above cᵢᵀuᵢ,ⱼ+dᵢ = cⱼᵀuᵢ,ⱼ+dⱼ @param mode_i The mode i's index.
neural_network_lyapunov/simple_pwl_lyapunov.py:134
↓ 2 callersMethodadd_dynamics_constraint
(self, mip, x_var,
neural_network_lyapunov/relu_system.py:486
↓ 2 callersMethodadd_dynamics_constraint_tester
(self, dut)
neural_network_lyapunov/examples/car/test/test_unicycle.py:181
↓ 2 callersMethodadd_dynamics_constraint_tester
(self, dut)
neural_network_lyapunov/examples/car/test/test_unicycle.py:341
↓ 2 callersMethodadd_dynamics_mip_constraint
Overloads add_dynamics_mip_constraint in the FeedbackSystem class When propagating the bounds through LP, we form a big LP containing
neural_network_lyapunov/examples/quadrotor3d/quadrotor_feedback_system.py:21
↓ 2 callersMethodadd_input_saturation_constraint_tester
(self, u_lower_limit, u_upper_limit, u_pre_sat_lo,
neural_network_lyapunov/test/test_feedback_system.py:771
↓ 2 callersFunctionadd_package_paths
(parser: Parser)
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py:34
↓ 2 callersMethodadd_relu_gradient_times_Aisi
This function is intended for internal usage only (but I expose it as a public function for unit test). Add sum_i ∂ReLU(x)/∂x
neural_network_lyapunov/continuous_time_lyapunov.py:437
↓ 2 callersMethodadd_relu_gradient_times_gigammai
This function is intended for internal usage only (but I expose it as a public function for unit test). Add sum_i ∂ReLU(x)/∂x
neural_network_lyapunov/continuous_time_lyapunov.py:544
↓ 2 callersMethodadd_relu_gradient_times_xdot
This function is intended for internal usage only (but I expose it as a public function for unit test). Add sum_i ∂ReLU(x)/∂x
neural_network_lyapunov/continuous_time_lyapunov.py:495
↓ 2 callersMethodadd_sign_state_error_times_Aisi
This function is intended for internal usage only (but I expose it as a public function for unit test). Adds ∑ᵢ ∑ⱼ sign(x(j)-
neural_network_lyapunov/continuous_time_lyapunov.py:604
↓ 2 callersMethodadd_sign_state_error_times_gigammai
This function is intended for internal usage only (but I expose it as a public function for unit test). Adds ∑ᵢ ∑ⱼ sign(x(j)-
neural_network_lyapunov/continuous_time_lyapunov.py:668
↓ 2 callersMethodadd_sign_state_error_times_xdot
This function is intended for internal usage only (but I expose it as a public function for unit test). Adds ∑ᵢ sign(x(i)-x*(
neural_network_lyapunov/continuous_time_lyapunov.py:732
↓ 2 callersMethodapex_to_touchdown_gradient
Computes the gradient of the pre-touchdown state x_pre_td w.r.t the apex state (x position, height above ground at touchdown, and x
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:323
↓ 2 callersMethodbarrier_sample_loss
Compute the sum of these three losses 1. Loss of -h(x) on safe states. 2. Loss of h(x) on unsafe states. 3. Loss of -
neural_network_lyapunov/train_lyapunov_barrier.py:275
↓ 2 callersMethodbox_boundary_tester
(self, x_lo, x_up)
neural_network_lyapunov/test/test_utils.py:1341
↓ 2 callersFunctioncheck_lyapunov_grad
@param eval_fun takes in the controller relu parameter and lyapunov relu parameter, returns a torch 0-dimensional tensor.
neural_network_lyapunov/test/feedback_gradient_check.py:271
↓ 2 callersMethodcompute_Wz_bounds_IA_tester
(self, dut, vector_lower, vector_upper)
neural_network_lyapunov/test/test_relu_to_optimization.py:763
↓ 2 callersMethodcompute_network_output_bounds_tester
(self, network, x_lo, x_up, method)
neural_network_lyapunov/test/test_relu_to_optimization.py:1707
↓ 2 callersMethodcompute_objective_from_mip_data
Compute the optimal objective as a function of MIQP data. If we fix the binary variable ζ, and take out the active linear con
neural_network_lyapunov/gurobi_torch_mip.py:1299
↓ 2 callersFunctioncompute_range_by_IA
Given x_lb <= x <= x_ub, compute the bounds on A * x + b by interval arithmetics (IA). Notice that this allows the computed bounds to be
neural_network_lyapunov/mip_utils.py:413
↓ 2 callersMethodcompute_region_of_attraction
After we have found the Lyapunov function satisfying the positivity and derivative conditions, i.e., V(x) > 0 and dV(x) < 0 for all
neural_network_lyapunov/lyapunov.py:1078
↓ 2 callersMethodcompute_relu_unit_outputs_and_activation
This is a utility function for output_constraint(). Given a network input x, this function computes the vector containing each ReLU u
neural_network_lyapunov/relu_to_optimization.py:859
↓ 2 callersFunctioncompute_total_loss
(system, x_equilibrium, relu_layer_width, params_val, V_lambda, lyapunov_positivity_eps
neural_network_lyapunov/test/debug_gradient.py:22
↓ 2 callersMethodconnect_state_extend
First try to connect x_extend to each node in the neighbours, find the connection with the smallest cost-to-root from x_extend, add t
neural_network_lyapunov/examples/car/rrt_star.py:174
↓ 2 callersMethodconstruct_hybrid_linear_system_example
(self)
neural_network_lyapunov/test/test_feedback_system.py:96
↓ 2 callersMethodconstruct_hybrid_linear_system_example
(self)
neural_network_lyapunov/test/test_hybrid_linear_system.py:476
↓ 2 callersMethodconstruct_milp_for_roa_boundary
(self, V_lambda, R, x_equilibrium)
neural_network_lyapunov/test/test_lyapunov_roa.py:220
↓ 2 callersMethodconstruct_relu_forward_system
(self)
neural_network_lyapunov/test/test_feedback_system.py:139
↓ 2 callersMethodconstruct_relu_second_order_residue_system_given_equilibrium
(self)
neural_network_lyapunov/test/test_feedback_system.py:307
↓ 2 callersMethodconstruct_relu_system_example
(self)
neural_network_lyapunov/test/test_relu_system.py:628
↓ 2 callersFunctioncost_trajectory
(nT, ut)
neural_network_lyapunov/examples/car/unicycle_traj_opt.py:20
↓ 2 callersMethodderivative_as_milp
Compute max -h(x[n+1]) + h(x[n]) - ε*h(x[n]) as an MILP. The objective is −ϕ(x[n+1]) + (1−ε)ϕ(x[n]) + εϕ(x*) - εc
neural_network_lyapunov/barrier.py:157
↓ 2 callersMethodderivative_loss_at_samples_and_next_states
Take the sample state xⁱ, and compute the total loss on all these samples. Each state has a loss max(−hdot(xⁱ)−εh(xⁱ) + margin, 0).
neural_network_lyapunov/barrier.py:212
↓ 2 callersFunctiondown_sample
(X, factor=1, range="full")
neural_network_lyapunov/examples/car/train_car_depth_dynamics.py:413
↓ 2 callersMethoddynamics_gradient
Returns the gradient of the dynamics
neural_network_lyapunov/examples/pendulum/pendulum.py:63
↓ 2 callersMethoddynamics_gradient
Compute the dynamics gradient A = ∂f/∂x, B = ∂f/∂u
neural_network_lyapunov/examples/quadrotor3d/quadrotor.py:118
↓ 2 callersMethoddynamics_gradient
Compute the gradient A = ∂f/∂x, B = ∂f/∂u
neural_network_lyapunov/examples/car/unicycle.py:37
↓ 2 callersMethodempty_constraint_tester
(self, c)
neural_network_lyapunov/test/test_mip_utils.py:247
↓ 2 callersMethodenergy_shaping_control
The control law is u = -k*thetadot * (E - E_des)
neural_network_lyapunov/examples/pendulum/pendulum.py:51
← previousnext →201–300 of 1,470, ranked by callers