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

        # initialized variables
        v, _, _ = 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
            # mul_lbda = layer_params.get('threshold', 1.0)
            # mul_lbda = check_tensor(mul_lbda)
            Wx = layer_params['Wx']
            Wv = layer_params['Wv']

            # apply one 'dual iteration'
            v = v.matmul(Wv) + x.matmul(Wx)
            v = torch.clamp(v, -lbda, lbda)
            # v = torch.clamp(v, -lbda * mul_lbda, lbda * mul_lbda)

        return v
 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)
        v, _, _ = 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']
            Wv = layer_params['Wv']
            v = v.matmul(Wv) + x.matmul(Wx)
            v = torch.clamp(v, -lbda, lbda)
        return v
def forward ( self , x , lbda , output_layer = None ) : output_layer = self . check_output_layer ( output_layer ) v , _ , _ = 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' ] Wv = layer_params [ 'Wv' ] v = v . matmul ( Wv ) + x . matmul ( Wx ) v = torch . clamp ( v , - lbda , lbda ) return v
Forward pass of the network.
Forward pass of the network .
""" Forward pass of the network. """ # initialized variables # retrieve parameters # mul_lbda = layer_params.get('threshold', 1.0) # mul_lbda = check_tensor(mul_lbda) # apply one 'dual iteration' # v = torch.clamp(v, -lbda * mul_lbda, lbda * mul_lbda)
self
x
lbda
output_layer