Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1#!/usr/bin/env python 

2# coding=utf-8 

3 

4"""DRIU Network for Vessel Segmentation 

5 

6Deep Retinal Image Understanding (DRIU), a unified framework of retinal image 

7analysis that provides both retinal vessel and optic disc segmentation using 

8deep Convolutional Neural Networks (CNNs). 

9 

10Reference: [MANINIS-2016]_ 

11""" 

12 

13from torch.optim.lr_scheduler import MultiStepLR 

14 

15from bob.ip.binseg.engine.adabound import AdaBound 

16from bob.ip.binseg.models.driu import driu 

17from bob.ip.binseg.models.losses import SoftJaccardBCELogitsLoss 

18 

19# config 

20lr = 0.001 

21betas = (0.9, 0.999) 

22eps = 1e-08 

23weight_decay = 0 

24final_lr = 0.1 

25gamma = 1e-3 

26eps = 1e-8 

27amsbound = False 

28 

29scheduler_milestones = [900] 

30scheduler_gamma = 0.1 

31 

32model = driu() 

33 

34optimizer = AdaBound( 

35 model.parameters(), 

36 lr=lr, 

37 betas=betas, 

38 final_lr=final_lr, 

39 gamma=gamma, 

40 eps=eps, 

41 weight_decay=weight_decay, 

42 amsbound=amsbound, 

43) 

44criterion = SoftJaccardBCELogitsLoss(alpha=0.7) 

45 

46scheduler = MultiStepLR( 

47 optimizer, milestones=scheduler_milestones, gamma=scheduler_gamma 

48)