LION.models.post_processing.cFBPConvNet

Classes

ConvODEFunc(channels[, relu_type, ...])

The right-hand side of a first-order neural ODE: convolutions through the channels listed, with batch normalisation and relu_type.

ConvSODEFunc(channels[, relu_type, ...])

The right-hand side of a second-order neural ODE: the state is (position, velocity) along the channels.

Down()

Downscaling with maxpool

InitialVelocity(channels)

The initial velocity of a second-order neural ODE, from the initial position.

ODEBlock(odefunc[, tol, adjoint, solver])

Solves the neural ODE odefunc from time 0 to 1 (torchdiffeq).

Up(channels[, stride, relu_type])

Upscaling with transpose conv

cFBPConvNet([operator_params, model_parameters])

Continuous FBPConvNet: FBPConvNet with every convolution block replaced by a neural ODE block.


class LION.models.post_processing.cFBPConvNet.ConvODEFunc(channels, relu_type='ReLU', relu_last=True, kernel_size=3)[source]

Bases: Module

The right-hand side of a first-order neural ODE: convolutions through the channels listed, with batch normalisation and relu_type.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(t, x)[source]

dx/dt at x (t unused: autonomous).

class LION.models.post_processing.cFBPConvNet.ConvSODEFunc(channels, relu_type='ReLU', relu_last=True, kernel_size=3)[source]

Bases: Module

The right-hand side of a second-order neural ODE: the state is (position, velocity) along the channels.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(t, x)[source]

The state’s derivative at x: (velocity, acceleration).

class LION.models.post_processing.cFBPConvNet.Down[source]

Bases: Module

Downscaling with maxpool

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

x halved in size (max pooling).

class LION.models.post_processing.cFBPConvNet.InitialVelocity(channels)[source]

Bases: Module

The initial velocity of a second-order neural ODE, from the initial position.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x0)[source]

The ODE’s state at time 0: the position x0 and its velocity, along the channels.

class LION.models.post_processing.cFBPConvNet.ODEBlock(odefunc, tol=0.001, adjoint=False, solver='rk4')[source]

Bases: Module

Solves the neural ODE odefunc from time 0 to 1 (torchdiffeq).

odefunc: the ODE’s right-hand side; tol: the solver’s relative and absolute tolerance; adjoint: gradients by the adjoint method (less memory); solver: a torchdiffeq method.

forward(x, eval_times=None, solver=None)[source]

The ODE’s solution at time 1 from x (or at each of eval_times), with solver (the block’s if None).

class LION.models.post_processing.cFBPConvNet.Up(channels, stride=2, relu_type='ReLU')[source]

Bases: Module

Upscaling with transpose conv

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

x doubled in size (transposed convolution).

class LION.models.post_processing.cFBPConvNet.cFBPConvNet(operator_params=None, model_parameters=None)[source]

Bases: LIONmodel

Continuous FBPConvNet: FBPConvNet with every convolution block replaced by a neural ODE block. Takes the FDK reconstruction as input (IMAGE) and returns input + residual, like FBPConvNetImage.

Initialize internal Module state, shared by both nn.Module and ScriptModule.

static default_parameters()[source]

FBPConvNet’s channels, each block a neural ODE (its input lifted by a 1x1 convolution), and the ODEs’ settings:

  • tol: the solver’s tolerance (1e-3);

  • ode_adjoint: gradients by the adjoint method (False);

  • do_second_order: second-order ODEs (False; not implemented yet);

  • solver: a torchdiffeq method (“rk4”).

static cite(cite_format='bib')[source]

Where cFBPConvNet comes from: its citation, BibTeX (“bib”) or “MLA”.

forward(x)[source]

x: FDK reconstructions, (B, 1, H, W).