neuralop.layers.padding.DomainPadding

class neuralop.layers.padding.DomainPadding(domain_padding: float | list, resolution_scaling_factor: int | List[int] = 1)[source]

Applies domain padding scaled automatically to the input’s resolution.

Parameters:
domain_paddingfloat or list

Typically, between zero and one, percentage of padding to use if a list, make sure if matches the dim of (d1, …, dN)

resolution_scaling_factorint, optional

Resolution scaling factor, by default 1

Methods

forward(x)

forward pass: pad the input

pad(x[, verbose])

Take an input and pad it by the desired fraction

unpad(x)

Remove the padding from padding inputs

Notes

This class works for any input resolution. Expects inputs of shape (batch-size, channels, d1, …., dN)

forward(x)[source]

forward pass: pad the input

pad(x, verbose=False)[source]

Take an input and pad it by the desired fraction

The amount of padding will be automatically scaled with the resolution

unpad(x)[source]

Remove the padding from padding inputs