Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/alisiahkoohi/Langevin-dynamics
/ functions
Functions
26 in github.com/alisiahkoohi/Langevin-dynamics
⨍
Functions
26
◇
Types & classes
6
↓ 6 callers
Method
sample
(self)
examples/gaussian_LD.py:34
↓ 4 callers
Method
lr_fn
(t: float, a: float = a, b: float = b, gamma: float = ga
src/langevin_sampling/samplers.py:265
↓ 2 callers
Method
nl_pdf
(self, x)
examples/gaussian_LD.py:30
↓ 2 callers
Method
proposal_dist
Calculate the proposal distribution for Metropolis-Hastings. Args: idx (int): Index of the current tensor. Retu
src/langevin_sampling/samplers.py:218
↓ 2 callers
Method
sample
(self)
examples/gaussian_MALA.py:33
↓ 2 callers
Method
step
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model
src/langevin_sampling/SGLD.py:43
↓ 1 callers
Method
__init__
(self, x: torch.Tensor, func: callable, lr: float = 1e-2,
src/langevin_sampling/samplers.py:30
↓ 1 callers
Method
decay_fn
Calculate the learning rate decay function. Args: lr (float): Initial learning rate. lr_final (float): Final
src/langevin_sampling/samplers.py:64
↓ 1 callers
Method
decay_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 callers
Method
lr_decay
Update the learning rate of the optimizer based on the current iteration.
src/langevin_sampling/samplers.py:103
↓ 1 callers
Method
lr_decay
Decay the learning rate of the optimizer.
src/langevin_sampling/samplers.py:273
↓ 1 callers
Method
lr_fn
Calculate the learning rate based on the iteration number. Args: t (float): Current iteration number.
src/langevin_sampling/samplers.py:83
↓ 1 callers
Method
sample_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
Method
nl_pdf
(self, x)
examples/gaussian_MALA.py:29
Function
rosenbrock_negative_log
(x)
examples/banana_LD.py:18
Function
rosenbrock_negative_log
(x)
examples/banana_MALA.py:18
Method
sample
Perform a Langevin dynamics step. Returns: tuple: A tuple containing the current parameter values and the loss
src/langevin_sampling/samplers.py:48
Method
sample
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
Method
step
Performs a single optimization step. Args: closure (callable, optional): A closure that reevaluates the model and
src/langevin_sampling/precondSGLD.py:55