lignn
LogicLoss
Bases: Module
Theory-informed loss function for determining topology diagram validity
Source code in src/torch_structure/loss/lignn.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
forward(x, edge_index, batch, y, x2)
Compute the combined local and trail-connectivity loss.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor[N, C]
|
per-node predicted probability channels. |
required |
edge_index
|
Tensor[2, E]
|
edge connectivity. |
required |
batch
|
Tensor[N]
|
unused, kept for interface consistency. |
required |
y
|
Tensor[N]
|
target trail-edge count per node, used by the local loss. |
required |
x2
|
Tensor[N, C]
|
initial values propagated over
|
required |
Returns:
| Type | Description |
|---|---|
|
tuple[torch.Tensor, torch.Tensor, torch.Tensor]: the combined |
|
|
loss, the local loss, and the trail loss. |
Source code in src/torch_structure/loss/lignn.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |