pub struct HmcSamplerNd<P> { /* private fields */ }Implementations§
Source§impl<P> HmcSamplerNd<P>where
P: LogPdfNd + HasSupportNd,
impl<P> HmcSamplerNd<P>where
P: LogPdfNd + HasSupportNd,
pub fn new(log_pdf: P, opts: HmcOptions) -> Result<Self, BuildError>
pub fn init(&mut self) -> Result<(), SampleError>
pub fn init_with_rng<R: Rng + ?Sized>( &mut self, rng: &mut R, ) -> Result<(), SampleError>
pub fn sample(&mut self) -> Result<Vec<f64>, SampleError>
pub fn sample_with_rng<R: Rng + ?Sized>( &mut self, rng: &mut R, ) -> Result<Vec<f64>, SampleError>
Source§impl<P> HmcSamplerNd<P>where
P: LogPdfNd + HasSupportNd + GradientLogPdfNd,
impl<P> HmcSamplerNd<P>where
P: LogPdfNd + HasSupportNd + GradientLogPdfNd,
Sourcepub fn sample_with_gradient<R: Rng + ?Sized>(
&mut self,
rng: &mut R,
) -> Result<Vec<f64>, SampleError>
pub fn sample_with_gradient<R: Rng + ?Sized>( &mut self, rng: &mut R, ) -> Result<Vec<f64>, SampleError>
Same as sample_with_rng but uses analytic/compiled gradient.
Auto Trait Implementations§
impl<P> Freeze for HmcSamplerNd<P>where
P: Freeze,
impl<P> RefUnwindSafe for HmcSamplerNd<P>where
P: RefUnwindSafe,
impl<P> Send for HmcSamplerNd<P>where
P: Send,
impl<P> Sync for HmcSamplerNd<P>where
P: Sync,
impl<P> Unpin for HmcSamplerNd<P>where
P: Unpin,
impl<P> UnsafeUnpin for HmcSamplerNd<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for HmcSamplerNd<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more