neuralop.layers.skip_connections
.skip_connection
- neuralop.layers.skip_connections.skip_connection(in_features, out_features, n_dim=2, bias=False, skip_type='soft-gating')[source]
A wrapper for several types of skip connections. Returns an nn.Module skip connections, one of {‘identity’, ‘linear’, soft-gating’}
- Parameters:
- in_featuresint
number of input features
- out_featuresint
number of output features
- n_dimint, default is 2
Dimensionality of the input (excluding batch-size and channels).
n_dim=2
corresponds to having Module2D.- biasbool, optional
whether to use a bias, by default False
- skip_type{‘identity’, ‘linear’, soft-gating’}
kind of skip connection to use, by default “soft-gating”
- Returns:
- nn.Module
module that takes in x and returns skip(x)