MCPcopy Create free account
hub / github.com/PolymathicAI/AstroCLIP / forward

Method forward

astroclip/models/astroclip.py:60–72  ·  view source on GitHub ↗
(
        self,
        input: torch.Tensor,
        input_type: str,
    )

Source from the content-addressed store, hash-verified

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"]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected