Math optimization in C#

后端 未结 25 2325
悲&欢浪女
悲&欢浪女 2020-12-07 10:25

I\'ve been profiling an application all day long and, having optimized a couple bits of code, I\'m left with this on my todo list. It\'s the activation function for a neural

25条回答
  •  再見小時候
    2020-12-07 10:59

    There are a lot of good answers here. I would suggest running it through this technique, just to make sure

    • You're not calling it any more times than you need to.
      (Sometimes functions get called more than necessary, just because they are so easy to call.)
    • You're not calling it repeatedly with the same arguments
      (where you could use memoization)

    BTW the function you have is the inverse logit function,
    or the inverse of the log-odds-ratio function log(f/(1-f)).

提交回复
热议问题