microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

Why does sqrl use mean instead of sum? #967

Closed toelli-msft closed 2 years ago

toelli-msft commented 2 years ago

@cgravill @awf

sqrl checks whether the mean of its input is negative. The mean is then never used again. Wouldn't checking the sum be (slightly) quicker? Is there another reason to use mean here?

https://github.com/microsoft/knossos-ksc/blob/88e1491849f10893cb97e04281835477d6a19c9b/examples/dl-capsule/sqrl.py#L12-L13

awf commented 2 years ago

No reason at all - we should change it.