MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_freeze_encoder

Method test_freeze_encoder

tests/networks/nets/test_hovernet.py:202–209  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

200 self.assertEqual(check_kernels(net, HoVerNet.Mode.ORIGINAL), False)
201
202 def test_freeze_encoder(self):
203 net = HoVerNet(mode=HoVerNet.Mode.FAST, freeze_encoder=True)
204 with train_mode(net):
205 for _, param in net.res_blocks[1:].named_parameters():
206 self.assertFalse(param.requires_grad)
207 for name, param in net.res_blocks[0].named_parameters():
208 if param.requires_grad is True:
209 self.assertTrue("bna_block" or "shortcut" in name)
210
211 @parameterized.expand(ILL_CASES)
212 def test_ill_input_hyper_params(self, input_param):

Callers

nothing calls this directly

Calls 2

HoVerNetClass · 0.90
train_modeFunction · 0.90

Tested by

no test coverage detected