MCPcopy Create free account
hub / github.com/IGNF/FLAIR-1 / predict_step

Method predict_step

src/flair/task_module.py:206–213  ·  view source on GitHub ↗
(self, batch, batch_idx, dataloader_idx=0)

Source from the content-addressed store, hash-verified

204 return preds, targets
205
206 def predict_step(self, batch, batch_idx, dataloader_idx=0):
207 if self.use_metadata == True:
208 logits = self.forward(batch["img"], batch["mtd"])
209 else:
210 logits = self.forward(batch["img"], '')
211 proba = torch.softmax(logits, dim=1)
212 batch["preds"] = torch.argmax(proba, dim=1)
213 return batch
214
215

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.95

Tested by

no test coverage detected