curobo.opt.particle.particle_opt_utils module

class curobo.opt.particle.particle_opt_utils.SquashType(value)

Bases: Enum

An enumeration.

CLAMP = 0
CLAMP_RESCALE = 1
TANH = 2
IDENTITY = 3
curobo.opt.particle.particle_opt_utils.scale_ctrl(ctrl, action_lows, action_highs, squash_fn=SquashType.CLAMP)
Parameters:

squash_fn (SquashType) –

curobo.opt.particle.particle_opt_utils.get_stomp_cov(horizon, d_action, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32), cov_mode='acc', RETURN_M=False)

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

Parameters:
  • horizon (int) –

  • d_action (int) –

curobo.opt.particle.particle_opt_utils.gaussian_logprob(mean, cov, x, cov_type='full')

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

curobo.opt.particle.particle_opt_utils.gaussian_logprobgrad(mean, cov, x, cov_type='full')
curobo.opt.particle.particle_opt_utils.gaussian_entropy(cov=None, L=None)

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

curobo.opt.particle.particle_opt_utils.gaussian_kl(mean0, cov0, mean1, cov1, cov_type='full')

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

curobo.opt.particle.particle_opt_utils.cost_to_go(cost_seq, gamma_seq, only_first=False)

Calculate (discounted) cost to go for given cost sequence

Parameters:
  • cost_seq (Tensor) –

  • gamma_seq (Tensor) –

  • only_first (bool) –

Return type:

Tensor

curobo.opt.particle.particle_opt_utils.cost_to_go_np(cost_seq, gamma_seq)

Calculate (discounted) cost to go for given cost sequence

curobo.opt.particle.particle_opt_utils.matrix_cholesky(A)
curobo.opt.particle.particle_opt_utils.batch_cholesky(A)