BatchedGradientTarget

Trait BatchedGradientTarget 

Source
pub trait BatchedGradientTarget<T: Float, B: AutodiffBackend> {
    // Required method
    fn unnorm_logp_batch(&self, positions: Tensor<B, 2>) -> Tensor<B, 1>;
}
Expand description

A batched target trait for computing the unnormalized log density (and gradients) for a collection of positions.

Implement this trait for your target distribution to enable gradient-based sampling.

§Type Parameters

  • T: The floating-point type (e.g., f32 or f64).
  • B: The autodiff backend from the burn crate.

Required Methods§

Source

fn unnorm_logp_batch(&self, positions: Tensor<B, 2>) -> Tensor<B, 1>

Compute the log density for a batch of positions.

§Parameters
  • positions: A tensor of shape [n_chains, D] representing the current positions for each chain.
§Returns

A 1D tensor of shape [n_chains] containing the log density for each chain.

Implementors§