We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 884acd2 commit 63b5ee5Copy full SHA for 63b5ee5
README.md
@@ -21,9 +21,12 @@ topo_loss = TopoLoss(
21
LaplacianPyramid(layer_name = 'fc',factor_h=3.0, factor_w=3.0),
22
],
23
)
24
+loss = topo_loss.compute(model=model)
25
+## >>> tensor(0.8407, grad_fn=<DivBackward0>)
26
+loss.backward()
27
-print(topo_loss.compute(model=model, reduce_mean = True)) ## returns a single number as tensor for backward()
-print(topo_loss.compute(model=model, reduce_mean = False)) ## returns a dict with layer names as keys
28
+loss_dict = topo_loss.compute(model=model, reduce_mean = False) ## {"fc": }
29
+## >>> {'fc': tensor(0.8407, grad_fn=<MulBackward0>)}
30
```
31
32
## Running tests
0 commit comments