Skip to content

Commit

Permalink
improve name
Browse files Browse the repository at this point in the history
  • Loading branch information
quintenroets committed Apr 9, 2024
1 parent 68a7f45 commit 548cc16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/revnets/evaluations/weights/standardize/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class Standardizer:
neurons: InternalNeurons

def run(self) -> None:
sort_indices = calculate_sort_indices(self.neurons.incoming)
sort_indices = calculate_sort_order(self.neurons.incoming)
permute_output_weights(self.neurons.incoming, sort_indices)
permute_input_weights(self.neurons.outgoing, sort_indices)


def calculate_sort_indices(layer: nn.Module) -> torch.Tensor:
def calculate_sort_order(layer: nn.Module) -> torch.Tensor:
weights = extract_linear_layer_weights(layer)
p = 1 # use l1-norm because l2-norm is already standardized
sort_values = weights.norm(dim=1, p=p)
Expand Down

0 comments on commit 548cc16

Please sign in to comment.