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

        # initialized variables
        _, _, z = 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
            step_size = 1.0 / self.l_
            mul_lbda = layer_params.get('threshold', 1.0)
            Wx = layer_params['Wx']
            Wz = layer_params['Wz']

            # apply one 'iteration'
            z = z.matmul(Wz) + x.matmul(Wx)
            z = pseudo_soft_th_tensor(z, lbda * step_size, mul_lbda)

        return z
 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)
        _, _, z = 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}']
            step_size = 1.0 / self.l_
            mul_lbda = layer_params.get('threshold', 1.0)
            Wx = layer_params['Wx']
            Wz = layer_params['Wz']
            z = z.matmul(Wz) + x.matmul(Wx)
            z = pseudo_soft_th_tensor(z, lbda * step_size, mul_lbda)
        return z
def forward ( self , x , lbda , output_layer = None ) : output_layer = self . check_output_layer ( output_layer ) _ , _ , z = 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}' ] step_size = 1.0 / self . l_ mul_lbda = layer_params . get ( 'threshold' , 1.0 ) Wx = layer_params [ 'Wx' ] Wz = layer_params [ 'Wz' ] z = z . matmul ( Wz ) + x . matmul ( Wx ) z = pseudo_soft_th_tensor ( z , lbda * step_size , mul_lbda ) return z
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