curobo.util.sample_lib module

class curobo.util.sample_lib.SampleConfig(horizon: int, d_action: int, tensor_args: curobo.types.base.TensorDeviceType, fixed_samples: bool = True, sample_ratio: Dict[str, float] = <factory>, seed: int = 0, filter_coeffs: Optional[List[float]] = <factory>, n_knots: int = 3, scale_tril: Optional[float] = None, covariance_matrix: Optional[<built-in method tensor of type object at 0x7f99b3f8dfe0>] = None, sample_method: str = 'halton', cov_mode: str = 'vel', sine_period: int = 2, degree: int = 3)

Bases: object

Parameters:
  • horizon (int) –

  • d_action (int) –

  • tensor_args (TensorDeviceType) –

  • fixed_samples (bool) –

  • sample_ratio (Dict[str, float]) –

  • seed (int) –

  • filter_coeffs (List[float] | None) –

  • n_knots (int) –

  • scale_tril (float | None) –

  • covariance_matrix (tensor | None) –

  • sample_method (str) –

  • cov_mode (str) –

  • sine_period (int) –

  • degree (int) –

horizon: int
d_action: int
tensor_args: TensorDeviceType
fixed_samples: bool = True
sample_ratio: Dict[str, float]
seed: int = 0
filter_coeffs: List[float] | None
n_knots: int = 3
scale_tril: float | None = None
covariance_matrix: tensor | None = None
sample_method: str = 'halton'
cov_mode: str = 'vel'
sine_period: int = 2
degree: int = 3
class curobo.util.sample_lib.BaseSampleLib(sample_config)

Bases: SampleConfig

get_samples(sample_shape, base_seed, current_state=None, **kwargs)
filter_samples(eps)
filter_smooth(samples)
class curobo.util.sample_lib.HaltonSampleLib(sample_config)

Bases: BaseSampleLib

Parameters:

sample_config (SampleConfig) –

get_samples(sample_shape, base_seed=None, filter_smooth=False, **kwargs)
curobo.util.sample_lib.bspline(c_arr, t_arr=None, n=100, degree=3)
class curobo.util.sample_lib.KnotSampleLib(sample_config)

Bases: SampleConfig

Parameters:

sample_config (SampleConfig) –

get_samples(sample_shape, **kwargs)
class curobo.util.sample_lib.RandomSampleLib(sample_config)

Bases: BaseSampleLib

Parameters:

sample_config (SampleConfig) –

get_samples(sample_shape, base_seed=None, filter_smooth=False, **kwargs)
class curobo.util.sample_lib.SineSampleLib(sample_config)

Bases: BaseSampleLib

Parameters:

sample_config (SampleConfig) –

get_samples(sample_shape, base_seed=None, **kwargs)
generate_sine_wave(horizon=None)
class curobo.util.sample_lib.StompSampleLib(sample_config)

Bases: BaseSampleLib

Parameters:

sample_config (SampleConfig) –

get_samples(sample_shape, base_seed=None, **kwargs)
class curobo.util.sample_lib.SampleLib(sample_config)

Bases: BaseSampleLib

Parameters:

sample_config (SampleConfig) –

get_samples(sample_shape, base_seed=None, **kwargs)
curobo.util.sample_lib.get_ranged_halton_samples(dof, up_bounds, low_bounds, num_particles, tensor_args=TensorDeviceType(device='cpu', dtype=torch.float32), seed=123)
Parameters:

tensor_args (TensorDeviceType) –

class curobo.util.sample_lib.HaltonGenerator(ndims, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32), up_bounds=[1], low_bounds=[0], seed=123, store_buffer=2000)

Bases: object

Parameters:
reset()
fast_forward(steps)

Fast forward sampler by steps

Parameters:

steps (int) –

_get_samples(num_samples)
Parameters:

num_samples (int) –

get_samples(num_samples, bounded=False)
get_gaussian_samples(num_samples, variance=1.0)
curobo.util.sample_lib.generate_noise(cov, shape, base_seed, filter_coeffs=None, device=device(type='cpu'))

Generate correlated Gaussian samples using autoregressive process

curobo.util.sample_lib.generate_noise_np(cov, shape, base_seed, filter_coeffs=None)

Generate correlated noisy samples using autoregressive process

curobo.util.sample_lib.generate_prime_numbers(num)
curobo.util.sample_lib.generate_van_der_corput_sample(idx, base)
curobo.util.sample_lib.generate_van_der_corput_samples_batch(idx_batch, base)
curobo.util.sample_lib.generate_halton_samples(num_samples, ndims, bases=None, use_scipy_halton=True, seed=123, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))
Parameters:

tensor_args (TensorDeviceType) –

curobo.util.sample_lib.generate_gaussian_halton_samples(num_samples, ndims, bases=None, use_scipy_halton=True, seed=123, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32), variance=1.0)
curobo.util.sample_lib.generate_gaussian_sobol_samples(num_samples, ndims, seed, tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32))