def build_model(self):

        if self.model == 'model_34':
            self.G = model34_DeepSupervion()

        elif self.model == 'model_50A':
            self.G = model50A_DeepSupervion()

        elif self.model == 'model_50A_slim':
            self.G = model50A_slim_DeepSupervion()

        elif self.model == 'model_101A':
            self.G = model101A_DeepSupervion()

        elif self.model == 'model_101B':
            self.G = model101B_DeepSupervion()

        elif self.model == 'model_152':
            self.G = model152_DeepSupervion()

        elif self.model == 'model_154':
            self.G = model154_DeepSupervion()

        self.g_optimizer = torch.optim.SGD(filter(lambda p: p.requires_grad,
                                                  self.G.parameters()),
                                           self.g_lr,
                                           weight_decay=0.0002,
                                           momentum=0.9)
        self.print_network(self.G, 'G')
        if torch.cuda.is_available():
            self.G = torch.nn.DataParallel(self.G)
            self.G.cuda()
Пример #2
0
    def build_model(self):

        if self.model == 'model_34':
            self.G = model34_DeepSupervion()

        elif self.model == 'model_50A':
            self.G = model50A_DeepSupervion()

        elif self.model == 'model_101A':
            self.G = model101A_DeepSupervion()

        self.g_optimizer = torch.optim.SGD(filter(lambda p: p.requires_grad, self.G.parameters()),
                                           self.g_lr, weight_decay=0.0002, momentum=0.9)
        self.print_network(self.G, 'G')
        if torch.cuda.is_available():
            self.G = torch.nn.DataParallel(self.G)
            self.G.cuda()