Skip to content

Commit

Permalink
convert to normal float
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jan 21, 2025
1 parent 20d0b33 commit b16b4a3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def get_mean_positive_weight(
pos_weights = conn.kernel_weights[conn.kernel_weights > 0]
if len(pos_weights) == 0:
return 0
return numpy.mean(pos_weights)
return float(numpy.mean(pos_weights))

@overrides(AbstractSupportsSignedWeights.get_mean_negative_weight)
def get_mean_negative_weight(
Expand All @@ -329,7 +329,7 @@ def get_mean_negative_weight(
neg_weights = conn.kernel_weights[conn.kernel_weights < 0]
if len(neg_weights) == 0:
return 0
return numpy.mean(neg_weights)
return float(numpy.mean(neg_weights))

@overrides(AbstractSupportsSignedWeights.get_variance_positive_weight)
def get_variance_positive_weight(
Expand All @@ -338,7 +338,7 @@ def get_variance_positive_weight(
pos_weights = conn.kernel_weights[conn.kernel_weights > 0]
if len(pos_weights) == 0:
return 0
return numpy.var(pos_weights)
return float(numpy.var(pos_weights))

@overrides(AbstractSupportsSignedWeights.get_variance_negative_weight)
def get_variance_negative_weight(
Expand All @@ -347,4 +347,4 @@ def get_variance_negative_weight(
neg_weights = conn.kernel_weights[conn.kernel_weights < 0]
if len(neg_weights) == 0:
return 0
return numpy.var(neg_weights)
return float(numpy.var(neg_weights))

0 comments on commit b16b4a3

Please sign in to comment.