MCPcopy Create free account
hub / github.com/ElliotVincent/SitsSCD / __init__

Method __init__

models/module.py:8–16  ·  view source on GitHub ↗
(self, cfg)

Source from the content-addressed store, hash-verified

6
7class SitsScdModel(L.LightningModule):
8 def __init__(self, cfg):
9 super().__init__()
10 self.cfg = cfg
11 self.model = instantiate(cfg.network.instance)
12 self.loss = instantiate(cfg.loss.instance)
13 self.ignore_index = self.loss.ignore_index
14 self.val_metrics = {'out': instantiate(cfg.val_metrics), 'in': instantiate(cfg.val_metrics)}
15 self.test_metrics = {'out': instantiate(cfg.test_metrics), 'in': instantiate(cfg.test_metrics)}
16 self.domain_dict = {0: 'out', 1: 'in'}
17
18 def training_step(self, batch, batch_idx):
19 pred = self.model(batch)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected