MCPcopy Create free account
hub / github.com/alexrame/fishr / create_clone

Method create_clone

domainbed/algorithms.py:134–144  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

132 self.optimizer_inner_state = None
133
134 def create_clone(self, device):
135 self.network_inner = networks.WholeFish(
136 self.input_shape, self.num_classes, self.hparams, weights=self.network.state_dict()
137 ).to(device)
138 self.optimizer_inner = torch.optim.Adam(
139 self.network_inner.parameters(),
140 lr=self.hparams["lr"],
141 weight_decay=self.hparams['weight_decay']
142 )
143 if self.optimizer_inner_state is not None:
144 self.optimizer_inner.load_state_dict(self.optimizer_inner_state)
145
146 def fish(self, meta_weights, inner_weights, lr_meta):
147 meta_weights = ParamDict(meta_weights)

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected