carpet/lista_analysis.py
def forward(self, x, lbda, output_layer=None):
        """ Forward pass of the network. """
        output_layer = self.check_output_layer(output_layer)

        # initialized variables
        _, u, _ = init_vuz(self.A, self.D, x, inv_A=self.inv_A_,
                           device=self.device)

        for layer_id in range(output_layer):
            layer_params = self.parameter_groups[f'layer-{layer_id}']
            # retrieve parameters
            Wx = layer_params['Wx']
            Wu = layer_params['Wu']

            mul_lbda = layer_params.get('threshold', 1.0 / self.l_)
            mul_lbda = check_tensor(mul_lbda, device=self.device)
            if self.learn_prox == LEARN_PROX_PER_LAYER:
                prox_tv = self.prox_tv[layer_id]
            else:
                prox_tv = self.prox_tv

            # apply one 'iteration'. We need an extra integration step as
            # prox_tv is a synthesis algorithm which outputs the synthesis
            # variable z and not the analysis one u.
            u = u.matmul(Wu) + x.matmul(Wx)
            z = prox_tv(x=u, lbda=lbda * mul_lbda)
            u = torch.cumsum(z, dim=1)

        return u
 Forward pass of the network. 
Forward pass of the network.
Forward pass of the network .
def forward(self, x, lbda, output_layer=None):
        output_layer = self.check_output_layer(output_layer)
        _, u, _ = init_vuz(self.A, self.D, x, inv_A=self.inv_A_,
                           device=self.device)
        for layer_id in range(output_layer):
            layer_params = self.parameter_groups[f'layer-{layer_id}']
            Wx = layer_params['Wx']
            Wu = layer_params['Wu']
            mul_lbda = layer_params.get('threshold', 1.0 / self.l_)
            mul_lbda = check_tensor(mul_lbda, device=self.device)
            if self.learn_prox == LEARN_PROX_PER_LAYER:
                prox_tv = self.prox_tv[layer_id]
            else:
                prox_tv = self.prox_tv
            u = u.matmul(Wu) + x.matmul(Wx)
            z = prox_tv(x=u, lbda=lbda * mul_lbda)
            u = torch.cumsum(z, dim=1)
        return u
def forward ( self , x , lbda , output_layer = None ) : output_layer = self . check_output_layer ( output_layer ) _ , u , _ = init_vuz ( self . A , self . D , x , inv_A = self . inv_A_ , device = self . device ) for layer_id in range ( output_layer ) : layer_params = self . parameter_groups [ f'layer-{layer_id}' ] Wx = layer_params [ 'Wx' ] Wu = layer_params [ 'Wu' ] mul_lbda = layer_params . get ( 'threshold' , 1.0 / self . l_ ) mul_lbda = check_tensor ( mul_lbda , device = self . device ) if self . learn_prox == LEARN_PROX_PER_LAYER : prox_tv = self . prox_tv [ layer_id ] else : prox_tv = self . prox_tv u = u . matmul ( Wu ) + x . matmul ( Wx ) z = prox_tv ( x = u , lbda = lbda * mul_lbda ) u = torch . cumsum ( z , dim = 1 ) return u
Forward pass of the network.
Forward pass of the network .
""" Forward pass of the network. """ # initialized variables # retrieve parameters # apply one 'iteration'. We need an extra integration step as # prox_tv is a synthesis algorithm which outputs the synthesis # variable z and not the analysis one u.
self
x
lbda
output_layer