storm_kit.mpc.control.control_utils module

batch_cholesky(A)[source]
cost_to_go(cost_seq, gamma_seq)[source]

Calculate (discounted) cost to go for given cost sequence

cost_to_go_np(cost_seq, gamma_seq)[source]

Calculate (discounted) cost to go for given cost sequence

gaussian_entropy(cov=None, L=None)[source]

Entropy of multivariate gaussian given either covariance or cholesky decomposition of covariance

gaussian_kl(mean0, cov0, mean1, cov1, cov_type='full')[source]

KL-divergence between Gaussians given mean and covariance KL(p||q) = E_{p}[log(p) - log(q)]

gaussian_logprob(mean, cov, x, cov_type='full')[source]

Calculate gaussian log prob for given input batch x :param mean (np.ndarray): :type mean (np.ndarray): [N x num_samples] batch of means :param cov (np.ndarray): :type cov (np.ndarray): [N x N] covariance matrix :param x (np.ndarray): :type x (np.ndarray): [N x num_samples] batch of sample values

Returns

log_prob (np.ndarray)

Return type

[num_sampls] log probability of each sample

gaussian_logprobgrad(mean, cov, x, cov_type='full')[source]
generate_gaussian_halton_samples(num_samples, ndims, bases=None, use_ghalton=True, seed_val=123, device=device(type='cpu'), float_dtype=torch.float64)[source]
generate_gaussian_sobol_samples(num_samples, ndims, seed_val, device=device(type='cpu'), float_dtype=torch.float64)[source]
generate_halton_samples(num_samples, ndims, bases=None, use_ghalton=True, seed_val=123, device=device(type='cpu'), float_dtype=torch.float64)[source]
generate_noise(cov, shape, base_seed, filter_coeffs=None, device=device(type='cpu'))[source]

Generate correlated Gaussian samples using autoregressive process

generate_noise_np(cov, shape, base_seed, filter_coeffs=None)[source]

Generate correlated noisy samples using autoregressive process

generate_prime_numbers(num)[source]
generate_van_der_corput_sample(idx, base)[source]
generate_van_der_corput_samples_batch(idx_batch, base)[source]
get_stomp_cov(horizon, d_action, tensor_args={'device': device(type='cpu'), 'dtype': torch.float32}, cov_mode='vel', RETURN_R=False)[source]

Computes the covariance matrix following STOMP motion planner

Coefficients from here: https://en.wikipedia.org/wiki/Finite_difference_coefficient More info here: https://github.com/ros-industrial/stomp_ros/blob/7fe40fbe6ad446459d8d4889916c64e276dbf882/stomp_core/src/utils.cpp#L36

matrix_cholesky(A)[source]
scale_ctrl(ctrl, action_lows, action_highs, squash_fn='clamp')[source]