MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / load_model

Method load_model

models/freematch_entropy/freematch.py:393–402  ·  view source on GitHub ↗
(self, load_path)

Source from the content-addressed store, hash-verified

391 self.print_fn(f"model saved: {save_filename}")
392
393 def load_model(self, load_path):
394 checkpoint = torch.load(load_path)
395
396 self.model.load_state_dict(checkpoint['model'])
397 self.ema_model = deepcopy(self.model)
398 self.ema_model.load_state_dict(checkpoint['ema_model'])
399 self.optimizer.load_state_dict(checkpoint['optimizer'])
400 self.scheduler.load_state_dict(checkpoint['scheduler'])
401 self.it = checkpoint['it']
402 self.print_fn('model loaded')
403
404 def interleave_offsets(self, batch, nu):
405 groups = [batch // (nu + 1)] * (nu + 1)

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected