Comment on Basic Neural Network on PythonparentComments−gamegoblin13yI usually use an array with a few thousand entries. In C this gives me a 2.5x speedup over the exact function with no important decrease in accuracy.−mistercow13yI wonder though if you might actually do better overall with a smaller lookup table and interpolation (or even just a polynomial approximation, which can be evaluated without branching), since large lookup tables can lead to bad cache behavior.−dfrodriguez143OP13yVery interesting and simple improvement. Definitely will take a look at that.
Comments
I usually use an array with a few thousand entries. In C this gives me a 2.5x speedup over the exact function with no important decrease in accuracy.
I wonder though if you might actually do better overall with a smaller lookup table and interpolation (or even just a polynomial approximation, which can be evaluated without branching), since large lookup tables can lead to bad cache behavior.
Very interesting and simple improvement. Definitely will take a look at that.