Skip to content

Couple of errors in eth_mnist.py #479

@GutiPerez

Description

@GutiPerez

Hi, I found the following errors in the file eth_mnist.py:

  1. The initialization of the variable labels, on line 171, should be inside the for loop in line 172. Otherwise, when you use more than one epoch, you will carry an additional element in labels from the previous epoch, and eventually, an error would raise in lines 209 and 214, as label_tensor and all_activity_pred or proportion_pred tensors will have different sizes.

  2. In the testing part, there is an error regarding the mean calculation on lines 352 and 353. The problem is that you are dividing by n_test, but because of the condition of the if, in line 315, is ">", instead of doing n_test evaluations, you are doing n_test+1, so the mean calculation is not correct. Given that you are using directly n_test, it would suggest changing the ">" by an ">=". Another option would be to divide by n_test+1, meaning that n_test starts from 0, which makes less sense for me.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions