plenoptic.models.Identity#
Note
This object is a torch.nn.Module. It therefore has all the methods and attributes
from that class, even though they are not documented here (to avoid cluttering this page).
- class plenoptic.models.Identity[source]#
Bases:
ModuleSimple class that just returns a copy of the image.
We use this as a “dummy model” for metrics that we don’t have the representation for. We use this as the model and then just change the objective function.
Examples
>>> import plenoptic as po >>> identity_model = po.models.Identity() >>> identity_model Identity()
Methods
forward(x)Return a copy of the tensor.
- forward(x)[source]#
Return a copy of the tensor.
- Parameters:
x (
Tensor) – The tensor to return.- Return type:
- Returns:
x – A clone of the input tensor.
Examples
>>> import plenoptic as po >>> identity_model = po.models.Identity() >>> img = po.data.curie() >>> y = identity_model.forward(img) >>> titles = ["Input", "Output (identical)"] >>> po.plot.imshow([img, y], title=titles) <PyrFigure ...>