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, device=self.device)

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

            # apply one 'iteration'
            residual = (u.matmul(self.A_) - x).matmul(self.A_.t())
            reg = u.matmul(self.D_).sign().matmul(self.D_.t())
            grad = residual + lbda * reg
            u = u - step_size * grad

        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, device=self.device)
        for layer_id in range(output_layer):
            layer_params = self.parameter_groups[f'layer-{layer_id}']
            step_size = layer_params['step_size']
            residual = (u.matmul(self.A_) - x).matmul(self.A_.t())
            reg = u.matmul(self.D_).sign().matmul(self.D_.t())
            grad = residual + lbda * reg
            u = u - step_size * grad
        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 , device = self . device ) for layer_id in range ( output_layer ) : layer_params = self . parameter_groups [ f'layer-{layer_id}' ] step_size = layer_params [ 'step_size' ] residual = ( u . matmul ( self . A_ ) - x ) . matmul ( self . A_ . t ( ) ) reg = u . matmul ( self . D_ ) . sign ( ) . matmul ( self . D_ . t ( ) ) grad = residual + lbda * reg u = u - step_size * grad return u
Forward pass of the network.
Forward pass of the network .
""" Forward pass of the network. """ # initialized variables # retrieve parameters # apply one 'iteration'
self
x
lbda
output_layer