MCPcopy Create free account

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

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

↓ 6 callersMethodstep_forward
(self, x)
neural_network_lyapunov/feedback_system.py:466
↓ 6 callersMethodstep_forward_at_equilibrium_test
(self, forward_system, controller_network, x_equilibrium,
neural_network_lyapunov/test/test_feedback_system.py:490
↓ 6 callersMethodtouchdown_transition
At touch down, the post touchdown state is [l0;θ;-ẋsinθ+ẏcosθ;(-ẋcosθ-ẏsinθ)/l0;x+l0sinθ] @param pre_state The pre-touch
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:88
↓ 5 callersMethodR
(self)
neural_network_lyapunov/r_options.py:130
↓ 5 callersFunctionadd_dynamics_constraint_tester
(tester, dut)
neural_network_lyapunov/test/test_relu_system.py:42
↓ 5 callersMethodapex_map
(x)
neural_network_lyapunov/test/test_spring_loaded_inverted_pendulum.py:450
↓ 5 callersMethodcheck_gradient
(self, rpy: torch.Tensor)
neural_network_lyapunov/test/test_geometry_transform.py:48
↓ 5 callersMethodcompute_u
(self, x)
neural_network_lyapunov/examples/car/unicycle_feedback_system.py:34
↓ 5 callersMethodconstraint_gradient_test
(self, linear_layer, relu_layer, z_curr_lo, z_curr_up)
neural_network_lyapunov/test/test_relu_to_optimization_utils.py:188
↓ 5 callersMethodconstraint_test
(self, linear_layer, relu_layer, z_curr_lo, z_curr_up)
neural_network_lyapunov/test/test_relu_to_optimization_utils.py:111
↓ 5 callersMethodconstruct_relu_forward_system_given_equilibrium
( self, x_equilibrium, u_equilibrium, discrete_time_flag)
neural_network_lyapunov/test/test_feedback_system.py:264
↓ 5 callersMethodderivative
Compute -h(x[n+1]) + h(x[n]) - ε*h(x[n]) Note that we want this value to be <= 0
neural_network_lyapunov/barrier.py:148
↓ 5 callersMethoddynamics
(self, x, u)
neural_network_lyapunov/examples/quadrotor3d/quadrotor.py:38
↓ 5 callersMethoddynamics_loss
computes the dynamics loss in state space (this is just L2 on the predicted states)
neural_network_lyapunov/dynamics_learning.py:570
↓ 5 callersMethodfind_path
Find the path between x1 and x2. We solve a nonlinear optimization problem. return the cost of the path.
neural_network_lyapunov/examples/car/rrt_star.py:117
↓ 5 callersMethodget_inequality_constraints
Return the matrices Ain_r, Ain_zeta, rhs_in as torch tensors.
neural_network_lyapunov/gurobi_torch_mip.py:901
↓ 5 callersMethodgiven_relu_test
(self, relu, network_input_lo, network_input_up, create_prog_callback, input_checker,
neural_network_lyapunov/test/test_relu_to_optimization.py:1492
↓ 5 callersMethodgradient_tester
(self, x, max_tol, grad_expected)
neural_network_lyapunov/test/test_utils.py:1297
↓ 5 callersMethodlqr_control
lqr control around the equilibrium (pi, 0). returns the controller gain K The control action should be u = K * (x - x_des)
neural_network_lyapunov/examples/pendulum/pendulum.py:78
↓ 5 callersMethodlyapunov_derivative
Compute V̇(x) + εV(x) for a given x. Notice that V̇(x) can have multiple values for a given x, for two reasons: 1. Wh
neural_network_lyapunov/continuous_time_lyapunov.py:322
↓ 5 callersMethodrelu_free_pattern_output_constraint_gradient_tester
(self, model)
neural_network_lyapunov/test/test_relu_to_optimization.py:469
↓ 5 callersMethodrelu_gradient_tester
This function only works when the gradient is unique.
neural_network_lyapunov/test/test_utils.py:1083
↓ 5 callersMethodreset
(self)
neural_network_lyapunov/examples/quadrotor2d/quadrotor2d_env.py:49
↓ 5 callersMethodreset_optimizer
resets the optimizers @param lyapunov_only boolean set to true to ONLY train the lyapunov. This is mostly useful for benchmar
neural_network_lyapunov/dynamics_learning.py:67
↓ 5 callersFunctionsetup_relu
@param symmetric_x If true, then we want the network satisfies network(x) = network(-x). This requires that bias=False, and the negative
neural_network_lyapunov/test/train_continuous_linear_system_toy_lyapunov.py:22
↓ 5 callersMethodstance_dynamics
In the stance phase, the state is [r,θ,ṙ,θ_dot,x_foot], where r is the leg length, and θ is the angle between the leg and the vertic
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:47
↓ 5 callersMethodstep_forward
(self, x_start, u_start)
neural_network_lyapunov/examples/pendulum/pendulum.py:208
↓ 5 callersMethodstep_forward
(self, x_start: torch.Tensor, u_start: torch.Tensor)
neural_network_lyapunov/examples/pole/pole_relu_system.py:63
↓ 5 callersMethodstrengthen_mip_at_point
Given a point (linear_inputs, relu_activations), strengthen the big-M formulation by adding the constraints with the most violation e
neural_network_lyapunov/relu_to_optimization.py:291
↓ 5 callersMethodtime_to_touchdown
For a flight state, computes the time to next touchdown on a given stepping stone. Returns None if the robot won't touch down on that
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:288
↓ 5 callersMethodtransform_input
Transform the input to be A * x + b. Originally the constraints are Ain_input * x + Ain_slack * s + Ain_binary * binary <= rh
neural_network_lyapunov/gurobi_torch_mip.py:124
↓ 4 callersMethod__init__
(self)
neural_network_lyapunov/r_options.py:10
↓ 4 callersMethod_add_controller_mip_constraint
(self, mip, x_var, u_var, controller_slack_var_name,
neural_network_lyapunov/feedback_system.py:263
↓ 4 callersMethod_compute_linear_output_bound_by_optimization
Compute the range of a linear layer output. We could solve an optimization problem (LP or MILP) to find (relaxed) bound of th
neural_network_lyapunov/relu_to_optimization.py:413
↓ 4 callersMethod_output_constraint_given_bounds
(self, z_pre_relu_lo, z_pre_relu_up, x_lo, x_up)
neural_network_lyapunov/relu_to_optimization.py:665
↓ 4 callersMethodadd_barrier
(self, barrier_system: barrier.Barrier, x_star, c, barrier_epsilon)
neural_network_lyapunov/train_lyapunov_barrier.py:213
↓ 4 callersMethodadd_controller_mip_constraint_tester
(self, dut, x_val)
neural_network_lyapunov/test/test_feedback_system.py:669
↓ 4 callersMethodadd_dynamics_constraint
Add the dynamic constraints a mixed-integer linear constraints. Refer to relu_system.py for the common API. The constraints a
neural_network_lyapunov/examples/car/unicycle.py:193
↓ 4 callersMethodadd_dynamics_mip_constraint
(self, mip, x_var,
neural_network_lyapunov/feedback_system.py:347
↓ 4 callersMethodadd_lyapunov_bounds_constraint
This function is intended for internal usage only (but I expose it as a public function for unit test). Add constraint lower
neural_network_lyapunov/lyapunov.py:368
↓ 4 callersFunctionadd_mode
(A, P, q)
neural_network_lyapunov/test/test_hybrid_linear_system.py:68
↓ 4 callersMethodadd_stepping_stone
Add a new stepping stone to the terrain. @param left The left boundary of the stepping stone. @param right The right boundary
neural_network_lyapunov/slip_hybrid_linear_system.py:15
↓ 4 callersMethodall_to_device
moves all the relevant parameters to device (e.g. 'cpu', 'cuda')
neural_network_lyapunov/dynamics_learning.py:532
↓ 4 callersFunctioncalculate_weight
(d, option="normal", std=1, slope=0.1)
neural_network_lyapunov/examples/car/train_car_depth_dynamics.py:423
↓ 4 callersMethodcan_touch_stepping_stone
Returns true if the robot can touch down on a stepping stone with the given leg angle. False otherwise.
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:314
↓ 4 callersFunctioncompute_milp_cost_given_relu
(system, x_equilibrium, relu_layer_width, params_val, V_lambda,
neural_network_lyapunov/test/debug_gradient.py:54
↓ 4 callersFunctioncompute_output_gradient_times_vec_intermediate_with_beta
Similar to compute_output_gradient_times_vec_intermediate(), but the value of beta (the activation of the ReLU unit is given)
neural_network_lyapunov/test/test_relu_to_optimization.py:48
↓ 4 callersMethodconstraint_test
(self, Wij, bij, relu_layer, neuron_input_lo, neuron_input_up)
neural_network_lyapunov/test/test_relu_to_optimization_utils.py:15
↓ 4 callersMethodconstraint_tester
(self, x_lo, x_up)
neural_network_lyapunov/test/test_utils.py:39
↓ 4 callersMethodconstruct_relu_system_example
(self)
neural_network_lyapunov/test/test_relu_system.py:299
↓ 4 callersMethoddynamics
Compute the time derivative of the state.
neural_network_lyapunov/examples/car/acceleration_car.py:23
↓ 4 callersFunctionflat_to_3d
(i)
neural_network_lyapunov/examples/car/value_iteration.py:198
↓ 4 callersMethodflight_dynamics
In the flight phase, the state is [x;y;xdot;ydot], the dynamics is state_dot = [xdot;ydot;0;-g] @param state A lenght 4 numpy
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:37
↓ 4 callersMethodgenerate_rollout
generates a rollouts of the system using pybullet @return X_data, tensor [N+2,num_channels,width,height] @return x_data, tens
neural_network_lyapunov/pybullet_data_generation.py:281
↓ 4 callersMethodgenerate_sample
generate a single transition from state x0. A first image is taken at time t=0, then another one at t=.5*dt. These two images are the
neural_network_lyapunov/pybullet_data_generation.py:179
↓ 4 callersFunctionget_entry
(entry_name, entry_index, *args)
neural_network_lyapunov/test/feedback_gradient_check.py:188
↓ 4 callersMethodkl_loss
compute the KL divergence from the samples produced @param z_mu tensor mean of the samples @param z_log_var tensor log of the
neural_network_lyapunov/dynamics_learning.py:756
↓ 4 callersMethodliftoff_guard
The lift off happens in the stance phase when the garud r - l0 crosses zero from below.
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:74
↓ 4 callersMethodliftoff_transition
At lift off, the post lift-off state is [x_foot-l0*sinθ; l0*cosθ; -r*cosθ*θ_dot-ṙsinθ;-r*sinθ*θ_dot+ṙcosθ] @param pre_state
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:107
↓ 4 callersMethodlyapunov_derivative_as_milp
We assume that the Lyapunov function V(x) = ReLU(x) - ReLU(x*) + λ|x-x*|₁, where x* is the equilibrium state. Formula
neural_network_lyapunov/continuous_time_lyapunov.py:957
↓ 4 callersMethodlyapunov_derivative_as_milp_gradient_tester
Test the gradient of the MILP optimal cost w.r.t the ReLU network weights and bias. I can first compute the gradient through pytorch
neural_network_lyapunov/test/test_lyapunov.py:1692
↓ 4 callersMethodlyapunov_derivative_as_milp_tester
(self, dut, x_equilibrium, V_lambda, epsilon, eps_type, R,
neural_network_lyapunov/test/test_continuous_time_lyapunov.py:111
↓ 4 callersMethodlyapunov_derivative_tester
(self, system, lyap_relu, x, x_equilibrium, V_lambda, epsilon, R)
neural_network_lyapunov/test/test_lyapunov.py:806
↓ 4 callersMethodlyapunov_sample_loss
Compute the cost as the summation of 1. hinge(-V(xⁱ) + ε₂ |xⁱ - x*|₁) for sampled state xⁱ. 2. hinge(dV(xⁱ) + ε V(xⁱ)) for sa
neural_network_lyapunov/train_lyapunov_barrier.py:226
↓ 4 callersMethodlyapunov_to_device
move all the parameters related to training the lyapunov to device @param device string for the device to move everything to
neural_network_lyapunov/dynamics_learning.py:92
↓ 4 callersMethodlyapunov_value_tester
(self, system, lyap_relu, x_equilibrium, V_lambda, R, x_val)
neural_network_lyapunov/test/test_lyapunov.py:534
↓ 4 callersMethodmaximal_separation_tester
(self, c, w, b, lo, up, xhat, beta_hat)
neural_network_lyapunov/test/test_mip_utils.py:88
↓ 4 callersMethodoutput_gradient_times_vector
We want to compute the gradient of the network ∂ReLU(x)/∂x times a vector y: ∂ReLU(x)/∂x * y, and reformulate this product as
neural_network_lyapunov/relu_to_optimization.py:1170
↓ 4 callersFunctionreplace_relu_with_mixed_integer_constraint
For a ReLU activation unit y = max(0, x), we can replace this function with mixed-integer linear constraint on x, y and β, where β is the bin
neural_network_lyapunov/utils.py:358
↓ 4 callersMethodrollout_loss
computes the reconstruction loss for a rollout @param rollout_expected tensor [N+1, x_dim] @return loss tensor of dim [N+1] o
neural_network_lyapunov/dynamics_learning.py:610
↓ 4 callersFunctionsetup_lyapunov_relu
()
neural_network_lyapunov/test/test_train_lyapunov_barrier.py:18
↓ 4 callersFunctionsetup_mip1
(dut)
neural_network_lyapunov/test/test_gurobi_torch_mip.py:372
↓ 4 callersFunctionsetup_state_samples_all
Generate samples in a rotated box region R(θ) * (x* + box) where box is lower <= x <= upper
neural_network_lyapunov/test/train_2d_lyapunov_utils.py:17
↓ 4 callersMethodsolve_barrier_value_mip
(self, safe_flag)
neural_network_lyapunov/train_lyapunov_barrier.py:527
↓ 4 callersFunctionstack_bounds
(bnd1, bnd2, num_var1, num_var2, upper_bound)
neural_network_lyapunov/gurobi_torch_mip.py:310
↓ 4 callersMethodstrengthen_lyapunov_derivative_as_milp
Strengthen the MILP for verifying Lyapunov derivative condition. The MILP from lyapunov_derivative_as_milp uses the big-M formulatio
neural_network_lyapunov/lyapunov.py:865
↓ 4 callersMethodstrengthen_relu_mip_at_solution
We typically strengthen the big-M MIP formulation of the ReLU network with the following idea: 1. Relax the binary variables
neural_network_lyapunov/relu_to_optimization.py:373
↓ 4 callersFunctiontest_step_forward_batch
(tester, dut, *args)
neural_network_lyapunov/test/test_relu_system.py:12
↓ 4 callersMethodvae_forward
full forward pass of the AE/VAE @param x tensor input @return x_decoded tensor, x encoded and then decoded @return x_
neural_network_lyapunov/dynamics_learning.py:718
↓ 4 callersFunctionvisualize_model
Visualize the depth measurement at the current time step and the next time step. Compare actual data with prediction. @param model_name:
neural_network_lyapunov/examples/car/train_car_depth_dynamics.py:338
↓ 4 callersMethody_range_tester
(self, c, w, b, x_coeffs, beta_coeffs, constants, x_hat)
neural_network_lyapunov/test/test_mip_utils.py:381
↓ 3 callersMethod__compute_Aisi_bounds
Compute the element-wise bounds on Aᵢsᵢ Aᵢsᵢ = Aᵢx when the mode i is active. Otherwise Aᵢsᵢ= 0 return (Aisi_lower, Aisi_uppe
neural_network_lyapunov/continuous_time_lyapunov.py:401
↓ 3 callersFunction_add_dynamics_constraint_autonmous
Args: mip_cnstr_return: Returned from mixed_integer_constraints() function. It encodes the constraint between x and x_next.
neural_network_lyapunov/relu_system.py:49
↓ 3 callersFunction_add_dynamics_mip_constraints
(mip, dynamic_system, x_var,
neural_network_lyapunov/relu_system.py:964
↓ 3 callersMethod_add_network_controller_mip_constraint
(self, mip, x_var, u_var, controller_slack_var_name,
neural_network_lyapunov/feedback_system.py:165
↓ 3 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/examples/car/unicycle_feedback_system.py:58
↓ 3 callersMethod_compute_Wz_bounds_IA
This function is used in output_gradient_times_vector. It computes the lower/upper bounds of Wᵢ*z through interval arithemetics (IA)ᵢ
neural_network_lyapunov/relu_to_optimization.py:1330
↓ 3 callersMethod_num_var
(self, Aout, Ain, Aeq)
neural_network_lyapunov/gurobi_torch_mip.py:91
↓ 3 callersMethod_training_params
The parameters to be trained.
neural_network_lyapunov/train_lyapunov_barrier.py:870
↓ 3 callersMethodadd_dynamics_constraint_tester
(self, dut, additional_u_lo, additional_u_up)
neural_network_lyapunov/examples/pole/test/test_pole_relu_system.py:73
↓ 3 callersMethodadd_linear_relaxation_by_layer_tester
(self, linear_layer, relu_layer, linear_input_lo,
neural_network_lyapunov/test/test_relu_to_optimization_utils.py:331
↓ 3 callersMethodadd_lyapunov_derivative_in_mode
Add the constraint (6) in the documentation above. s1 >= (cᵢᵀAᵢ+ε₂cᵢᵀ)vᵢʲ+cᵢᵀgᵢ+ε₂dᵢ @param mode_vertices mode_vertices[j] is
neural_network_lyapunov/simple_pwl_lyapunov.py:75
↓ 3 callersMethodadd_lyapunov_positivity_in_mode
Add constraint (7) in the documentation above. s2 >= -(cᵢᵀ-ε₁*sign(v̅ᵢʲ-x*))v̅ᵢʲ - dᵢ - ε₁*sign(v̅ᵢʲ-x*)x* @param mode_index
neural_network_lyapunov/simple_pwl_lyapunov.py:99
↓ 3 callersMethodadd_mixed_integer_linear_constraints_tester
( self, dut, Ain_r_expected, Ain_zeta_expected, rhs_in_expected, Aeq_r_expected, Aeq_z
neural_network_lyapunov/test/test_gurobi_torch_mip.py:990
↓ 3 callersMethodadd_network_controller_mip_constraint_tester
(self, x_val)
neural_network_lyapunov/examples/car/test/test_unicycle_feedback_system.py:97
↓ 3 callersMethodapex_to_apex_gradient
Compute the next apex state, together with the gradient of the next apex state w.r.t the current apex state and the leg angle.
neural_network_lyapunov/spring_loaded_inverted_pendulum.py:588
↓ 3 callersFunctioncombined_shape
(length, shape=None)
neural_network_lyapunov/examples/rl/td3.py:17
↓ 3 callersMethodcompute_lyapunov_derivative_loss_single_sample
(self, system, V_lambda, epsilon, x_equilibrium,
neural_network_lyapunov/test/test_continuous_time_lyapunov.py:1024
↓ 3 callersMethodcompute_milp_cost_given_relu
(self, system, weight_all, bias_all, requires_grad, eps_type, R, fixed_R)
neural_network_lyapunov/test/test_lyapunov.py:1626
↓ 3 callersMethodcompute_objective_from_mip_data
Given the active inequality constraints and the value for binary variables, compute the objective as a function of the MIP constraint
neural_network_lyapunov/gurobi_torch_mip.py:1114
← previousnext →101–200 of 1,470, ranked by callers