curobo.util.sample_lib module

class 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 0x7fd954a6f200>] = None,
sample_method: str = 'halton',
cov_mode: str = 'vel',
sine_period: int = 2,
degree: int = 3,
)

Bases: object

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 BaseSampleLib(sample_config)

Bases: SampleConfig

scale_tril: float | None = None
get_samples(
sample_shape,
base_seed,
current_state=None,
**kwargs,
)
filter_samples(eps)
filter_smooth(samples)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
filter_coeffs: List[float] | None
class HaltonSampleLib(
sample_config: SampleConfig,
)

Bases: BaseSampleLib

get_samples(
sample_shape,
base_seed=None,
filter_smooth=False,
**kwargs,
)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
filter_samples(eps)
filter_smooth(samples)
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
scale_tril: float | None = None
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
filter_coeffs: List[float] | None
bspline(
c_arr: Tensor,
t_arr=None,
n=100,
degree=3,
)
class KnotSampleLib(
sample_config: SampleConfig,
)

Bases: SampleConfig

scale_tril: float | None = None
get_samples(
sample_shape,
**kwargs,
)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
filter_coeffs: List[float] | None
class RandomSampleLib(
sample_config: SampleConfig,
)

Bases: BaseSampleLib

scale_tril: float | None = None
get_samples(
sample_shape,
base_seed=None,
filter_smooth=False,
**kwargs,
)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
filter_samples(eps)
filter_smooth(samples)
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
filter_coeffs: List[float] | None
class SineSampleLib(
sample_config: SampleConfig,
)

Bases: BaseSampleLib

get_samples(
sample_shape,
base_seed=None,
**kwargs,
)
generate_sine_wave(
horizon=None,
)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
filter_samples(eps)
filter_smooth(samples)
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
scale_tril: float | None = None
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
filter_coeffs: List[float] | None
class StompSampleLib(
sample_config: SampleConfig,
)

Bases: BaseSampleLib

filter_coeffs: List[float] | None
get_samples(
sample_shape,
base_seed=None,
**kwargs,
)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
filter_samples(eps)
filter_smooth(samples)
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
scale_tril: float | None = None
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
class SampleLib(
sample_config: SampleConfig,
)

Bases: BaseSampleLib

get_samples(
sample_shape,
base_seed=None,
**kwargs,
)
cov_mode: str = 'vel'
covariance_matrix: tensor | None = None
degree: int = 3
filter_samples(eps)
filter_smooth(samples)
fixed_samples: bool = True
n_knots: int = 3
sample_method: str = 'halton'
scale_tril: float | None = None
seed: int = 0
sine_period: int = 2
horizon: int
d_action: int
tensor_args: TensorDeviceType
sample_ratio: Dict[str, float]
filter_coeffs: List[float] | None
get_ranged_halton_samples(
dof,
up_bounds,
low_bounds,
num_particles,
tensor_args: TensorDeviceType = TensorDeviceType(device='cpu', dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
seed=123,
)
class HaltonGenerator(
ndims,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
up_bounds=[1],
low_bounds=[0],
seed=123,
store_buffer: int | None = 2000,
)

Bases: object

reset()
fast_forward(steps: int)

Fast forward sampler by steps

_get_samples(
num_samples: int,
)
get_samples(
num_samples,
bounded=False,
)
get_gaussian_samples(
num_samples,
variance=1.0,
)
bound_samples(
samples: Tensor,
range_b: Tensor,
low_bounds: Tensor,
)
gaussian_transform(
uniform_samples: Tensor,
proj_mat: Tensor,
i_mat: Tensor,
std_dev: float,
)

Compute a guassian transform of uniform samples.

Parameters:
Returns:

_description_

Return type:

_type_

generate_noise(
cov,
shape,
base_seed,
filter_coeffs=None,
device=device(type='cpu'),
)

Generate correlated Gaussian samples using autoregressive process

generate_noise_np(
cov,
shape,
base_seed,
filter_coeffs=None,
)

Generate correlated noisy samples using autoregressive process

generate_prime_numbers(num)
generate_van_der_corput_sample(
idx,
base,
)
generate_van_der_corput_samples_batch(
idx_batch,
base,
)
generate_halton_samples(
num_samples,
ndims,
bases=None,
use_scipy_halton=True,
seed=123,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)
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, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
variance=1.0,
)
generate_gaussian_sobol_samples(
num_samples,
ndims,
seed,
tensor_args=TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
)