MCPcopy Create free account
hub / github.com/dangf15/THLNet / get_params

Method get_params

nets/model.py:230–245  ·  view source on GitHub ↗
(self, weight_decay=0.0)

Source from the content-addressed store, hash-verified

228 return wav_lst
229
230 def get_params(self, weight_decay=0.0):
231 # add L2 penalty
232 weights, biases = [], []
233 for name, param in self.named_parameters():
234 if 'bias' in name:
235 biases += [param]
236 else:
237 weights += [param]
238 params = [{
239 'params': weights,
240 'weight_decay': weight_decay,
241 }, {
242 'params': biases,
243 'weight_decay': 0.0,
244 }]
245 return params
246
247if __name__ == '__main__':
248 import os

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected