Module laplace.curvature.asdl

Classes

class AsdlInterface (model, likelihood, last_layer=False)

Interface for asdfghjkl backend.

Ancestors

Subclasses

Static methods

def jacobians(model, x)

Compute Jacobians \nabla_\theta f(x;\theta) at current parameter \theta using asdfghjkl's gradient per output dimension.

Parameters

model : torch.nn.Module
 
x : torch.Tensor
input data (batch, input_shape) on compatible device with model.

Returns

Js : torch.Tensor
Jacobians (batch, parameters, outputs)
f : torch.Tensor
output function (batch, outputs)

Methods

def gradients(self, x, y)

Compute gradients \nabla_\theta \ell(f(x;\theta, y) at current parameter \theta using asdfghjkl's backend.

Parameters

x : torch.Tensor
input data (batch, input_shape) on compatible device with model.
y : torch.Tensor
 

Returns

loss : torch.Tensor
 
Gs : torch.Tensor
gradients (batch, parameters)

Inherited members

class AsdlGGN (model, likelihood, last_layer=False, stochastic=False)

Implementation of the GGNInterface using asdfghjkl.

Ancestors

Inherited members

class AsdlEF (model, likelihood, last_layer=False)

Implementation of the EFInterface using asdfghjkl.

Ancestors

Inherited members