コード例 #1
0
    def get_params_lr(self):
        """Helper function to adjust learning rate for each sub modules.
    """
        # Specify learning rate for each sub modules.
        ret = []
        ret.append({
            'params': [
                n for n in model_utils.get_params(
                    self, ['semantic_classifier'], ['weight'])
            ],
            'lr':
            10
        })
        ret.append({
            'params': [
                n for n in model_utils.get_params(
                    self, ['semantic_classifier'], ['bias'])
            ],
            'lr':
            20,
            'weight_decay':
            0
        })

        return ret
コード例 #2
0
ファイル: resnet_deeplab.py プロジェクト: twke18/SPML
    def get_params_lr(self):
        """Helper function to adjust learning rate for each sub modules.
    """
        # Specify learning rate for each sub modules.
        ret = []
        resnet_params_name = [
            'resnet_backbone.res3', 'resnet_backbone.res4',
            'resnet_backbone.res5'
        ]
        ret.append({
            'params': [
                n for n in model_utils.get_params(self, resnet_params_name,
                                                  ['weight'])
            ],
            'lr':
            1
        })
        ret.append({
            'params': [
                n for n in model_utils.get_params(self, resnet_params_name,
                                                  ['bias'])
            ],
            'lr':
            2,
            'weight_decay':
            0
        })
        ret.append({
            'params':
            [n for n in model_utils.get_params(self, ['aspp'], ['weight'])],
            'lr':
            10
        })
        ret.append({
            'params':
            [n for n in model_utils.get_params(self, ['aspp'], ['bias'])],
            'lr':
            20,
            'weight_decay':
            0
        })

        return ret