MCPcopy Create free account
hub / github.com/DragonisCV/RAM / __init__

Method __init__

ram/models/ram_plus_pretrain_model.py:19–31  ·  view source on GitHub ↗
(self, opt)

Source from the content-addressed store, hash-verified

17 """MIM model for masked image modeling."""
18
19 def __init__(self, opt):
20 super(RAMPlusPretrainModel, self).__init__(opt)
21 self.net_g = build_network(opt["network_g"])
22 self.net_g = self.model_to_device(self.net_g)
23 self.print_network(self.net_g)
24
25 self.net_mask = build_network(opt["network_mask"])
26 self.net_mask = self.model_to_device(self.net_mask)
27 self.print_network(self.net_mask)
28 if self.is_train:
29 self.init_training_settings()
30 else:
31 self.load_pretrained_models()
32
33 def init_training_settings(self):
34 self.net_g.train()

Callers

nothing calls this directly

Calls 5

build_networkFunction · 0.90
model_to_deviceMethod · 0.80
print_networkMethod · 0.80

Tested by

no test coverage detected