Skip to content

Commit

Permalink
Fix ValueError message in AlphaBeta
Browse files Browse the repository at this point in the history
Correct the error message to indicate that alpha and beta parameters must be
non-negative instead of positive.
  • Loading branch information
jacobkauffmann authored and chr5tphr committed Aug 22, 2023
1 parent c30e3cc commit e9c6e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zennit/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class AlphaBeta(BasicHook):
'''
def __init__(self, alpha=2., beta=1., stabilizer=1e-6, zero_params=None):
if alpha < 0 or beta < 0:
raise ValueError("Both alpha and beta parameters must be positive!")
raise ValueError("Both alpha and beta parameters must be non-negative!")
if (alpha - beta) != 1.:
raise ValueError("The difference of parameters alpha - beta must equal 1!")
mod_kwargs = {'zero_params': zero_params}
Expand Down

0 comments on commit e9c6e09

Please sign in to comment.