MCPcopy Index your code

hub / github.com/alisiahkoohi/Langevin-dynamics / functions

Functions26 in github.com/alisiahkoohi/Langevin-dynamics

↓ 6 callersMethodsample
(self)
examples/gaussian_LD.py:34
↓ 4 callersMethodlr_fn
(t: float, a: float = a, b: float = b, gamma: float = ga
src/langevin_sampling/samplers.py:265
↓ 2 callersMethodnl_pdf
(self, x)
examples/gaussian_LD.py:30
↓ 2 callersMethodproposal_dist
Calculate the proposal distribution for Metropolis-Hastings. Args: idx (int): Index of the current tensor. Retu
src/langevin_sampling/samplers.py:218
↓ 2 callersMethodsample
(self)
examples/gaussian_MALA.py:33
↓ 2 callersMethodstep
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model
src/langevin_sampling/SGLD.py:43
↓ 1 callersMethod__init__
(self, x: torch.Tensor, func: callable, lr: float = 1e-2,
src/langevin_sampling/samplers.py:30
↓ 1 callersMethoddecay_fn
Calculate the learning rate decay function. Args: lr (float): Initial learning rate. lr_final (float): Final
src/langevin_sampling/samplers.py:64
↓ 1 callersMethoddecay_fn
Generate a learning rate decay function. Args: lr (float, optional): Initial learning rate. Default is 1e-2.
src/langevin_sampling/samplers.py:245
↓ 1 callersMethodlr_decay
Update the learning rate of the optimizer based on the current iteration.
src/langevin_sampling/samplers.py:103
↓ 1 callersMethodlr_decay
Decay the learning rate of the optimizer.
src/langevin_sampling/samplers.py:273
↓ 1 callersMethodlr_fn
Calculate the learning rate based on the iteration number. Args: t (float): Current iteration number.
src/langevin_sampling/samplers.py:83
↓ 1 callersMethodsample_prob
Calculate the acceptance probability for Metropolis-Hastings. Returns: torch.Tensor: The acceptance probability.
src/langevin_sampling/samplers.py:235
Method__init__
(self, x: torch.Tensor, func: callable, lr: float = 1e-2,
src/langevin_sampling/samplers.py:144
Method__init__
(self, params, lr=required, momentum=0, da
src/langevin_sampling/SGLD.py:13
Method__init__
Initializes the pSGLD optimizer. Args: params (iterable): Iterable of parameters to optimize. lr (float, opt
src/langevin_sampling/precondSGLD.py:12
Method__init__
(self, mu, cov, device='cuda')
examples/gaussian_LD.py:19
Method__init__
(self, mu, cov, device='cuda')
examples/gaussian_MALA.py:18
Method__setstate__
(self, state)
src/langevin_sampling/SGLD.py:38
Method__setstate__
(self, state)
src/langevin_sampling/precondSGLD.py:50
Methodnl_pdf
(self, x)
examples/gaussian_MALA.py:29
Functionrosenbrock_negative_log
(x)
examples/banana_LD.py:18
Functionrosenbrock_negative_log
(x)
examples/banana_MALA.py:18
Methodsample
Perform a Langevin dynamics step. Returns: tuple: A tuple containing the current parameter values and the loss
src/langevin_sampling/samplers.py:48
Methodsample
Perform a Metropolis-Hastings step to generate a sample. Returns: tuple: A tuple containing the sampled input tensor and
src/langevin_sampling/samplers.py:188
Methodstep
Performs a single optimization step. Args: closure (callable, optional): A closure that reevaluates the model and
src/langevin_sampling/precondSGLD.py:55