Relative error
|a - n| / (|a| + |n|), a comparison of two numbers that is fair for both big and small gradients. Below 1e-6 means your gradient is correct, and above 1e-3 means a bug.
|a - n| / (|a| + |n|), a comparison of two numbers that is fair for both big and small gradients. Below 1e-6 means your gradient is correct, and above 1e-3 means a bug.