This is the course project for CSCE585: ML Systems. Students will build their machine learning systems based on the provided infrastructure --- Athena.
Describe the bug
The provided method to calculate error rate (in src\utils\metrics.py) is broken after the last update. It throws a runtime warning and returns nan.
To Reproduce
Simply run the tutorial craft_adversarial_examples.py, which now calls the error rate function and prints it to console.
Screenshots
Desktop:
OS: Windows
Additional Context
The score returned is score = float(num_incorrections / amount) which evaluates to nan in my case because both num_incorrections and amount are zero. The divide-by-zero can be easily fixed, but the real issue is that amount should not be zero in the first place.
Supposing input parameter correct_on_bs takes the default value of None, then we will have num_incorrect = y_pred.shape[0], and amount = (y_pred.shape[0] - num_incorrect) will also by default return zero. Thus the function will always return nan unless correct_on_bs is supplied.
good catch! I updated the algorithm at the last minute before submitted. It was computed using the incorrections and I changed it to use corrections and forgot to update the amount.
Describe the bug The provided method to calculate error rate (in src\utils\metrics.py) is broken after the last update. It throws a runtime warning and returns
nan
.To Reproduce Simply run the tutorial craft_adversarial_examples.py, which now calls the error rate function and prints it to console.
Screenshots
Desktop:
Additional Context The score returned is
score = float(num_incorrections / amount)
which evaluates tonan
in my case because bothnum_incorrections
andamount
are zero. The divide-by-zero can be easily fixed, but the real issue is that amount should not be zero in the first place.Supposing input parameter
correct_on_bs
takes the default value ofNone
, then we will havenum_incorrect = y_pred.shape[0]
, andamount = (y_pred.shape[0] - num_incorrect)
will also by default return zero. Thus the function will always returnnan
unlesscorrect_on_bs
is supplied.