Skip to content

Commit

Permalink
shorten variable
Browse files Browse the repository at this point in the history
  • Loading branch information
quintenroets committed Apr 17, 2024
1 parent 41388fd commit 390bcbe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/revnets/standardization/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ def _apply_optimize_mae(self) -> None:
def calculate_average_scale_per_layer(self) -> float:
connection = self.internal_connections[-1]
standardizer = scale.Standardizer(connection)
output_scales = standardizer.calculate_outgoing_scales(
connection.output_weights
)
output_scale = sum(output_scales) / len(output_scales)
scales = standardizer.calculate_outgoing_scales(connection.output_weights)
output_scale = sum(scales) / len(scales)
num_internal_connections = len(self.internal_connections)
average_scale = output_scale ** (1 / num_internal_connections)
return cast(float, average_scale)
Expand Down

0 comments on commit 390bcbe

Please sign in to comment.