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)
        mul_lbda = check_tensor(1.0 / self.l_, 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']
            if self.learn_th:
                mul_lbda = layer_params['threshold']

            # apply one 'iteration'
            u = u.matmul(Wu) + x.matmul(Wx)
            u = ProxTV_l1.apply(u, lbda * mul_lbda)

        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)
        mul_lbda = check_tensor(1.0 / self.l_, 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']
            if self.learn_th:
                mul_lbda = layer_params['threshold']
            u = u.matmul(Wu) + x.matmul(Wx)
            u = ProxTV_l1.apply(u, lbda * mul_lbda)
        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 ) mul_lbda = check_tensor ( 1.0 / self . l_ , 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' ] if self . learn_th : mul_lbda = layer_params [ 'threshold' ] u = u . matmul ( Wu ) + x . matmul ( Wx ) u = ProxTV_l1 . apply ( u , lbda * mul_lbda ) 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