topobench.nn.backbones.cell package#
Cell backbones with automated exports.
- class CCCN(in_channels, n_layers=2, dropout=0.0, last_act=False)#
Bases:
ModuleCCCN model.
- Parameters:
- in_channelsint
Number of input channels.
- n_layersint, optional
Number of layers (default: 2).
- dropoutfloat, optional
Dropout rate (default: 0).
- last_actbool, optional
If True, the last activation function is applied (default: False).
- __init__(in_channels, n_layers=2, dropout=0.0, last_act=False)#
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(x, Ld, Lu)#
Forward pass.
- Parameters:
- xtorch.Tensor
Input tensor.
- Ldtorch.Tensor
Domain adjacency matrix.
- Lutorch.Tensor
Label adjacency matrix.
- Returns:
- torch.Tensor
Output tensor.
- class CW(F_in, F_out)#
Bases:
ModuleLayer of the CCCN model.
- Parameters:
- F_inint
Number of input channels.
- F_outint
Number of output channels.
- __init__(F_in, F_out)#
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(xe, Lu, Ld)#
Forward pass.
- Parameters:
- xetorch.Tensor
Input tensor.
- Lutorch.Tensor
Domain adjacency matrix.
- Ldtorch.Tensor
Label adjacency matrix.
- Returns:
- torch.Tensor
Output tensor.