File size: 673 Bytes
a95f6c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import torch.nn as nn
import abc
### Abstract class

class Operator(nn.Module):

    @abc.abstractmethod
    def degradation(self, *args, **kwargs):
        '''
        Forward Pass for degradation with given parameters
        '''
        pass

    @abc.abstractmethod
    def update_params(self, *args, **kwargs):
        '''
        Method for updating parameteres in blind scenarios or when loading new settings with same class
        '''
        pass

    def prepare_optimization(self, x_den, y):
        """
        Some preprocessing for optimizing the parameters. Empty by default
        """
        return x_den, y

    def constrain_params(self):
        pass