MCPcopy Index your code
hub / github.com/JetBrains-Research/code2seq / training_step

Method training_step

code2seq/model/code2class.py:67–71  ·  view source on GitHub ↗
(self, batch: BatchedLabeledPathContext, batch_idx: int)

Source from the content-addressed store, hash-verified

65 return {f"{step}/loss": loss, f"{step}/accuracy": accuracy}
66
67 def training_step(self, batch: BatchedLabeledPathContext, batch_idx: int) -> Dict: # type: ignore
68 result = self._shared_step(batch, "train")
69 self.log_dict(result, on_step=True, on_epoch=False)
70 self.log("acc", result["train/accuracy"], prog_bar=True, logger=False)
71 return result["train/loss"]
72
73 def validation_step(self, batch: BatchedLabeledPathContext, batch_idx: int) -> Dict: # type: ignore
74 return self._shared_step(batch, "val")

Callers

nothing calls this directly

Calls 1

_shared_stepMethod · 0.95

Tested by

no test coverage detected