(
self,
input: torch.Tensor,
input_type: str,
)
| 58 | self.criterion = CLIPLoss() |
| 59 | |
| 60 | def forward( |
| 61 | self, |
| 62 | input: torch.Tensor, |
| 63 | input_type: str, |
| 64 | ): |
| 65 | if input_type == "image": |
| 66 | return self.image_encoder(input) |
| 67 | |
| 68 | elif input_type == "spectrum": |
| 69 | return self.spectrum_encoder(input) |
| 70 | |
| 71 | else: |
| 72 | raise ValueError("Input type must be either 'image' or 'spectrum'") |
| 73 | |
| 74 | def training_step(self, batch, batch_idx): |
| 75 | im, sp = batch["image"], batch["spectrum"] |
nothing calls this directly
no outgoing calls
no test coverage detected