Math optimization in C#

后端 未结 25 2295
悲&欢浪女
悲&欢浪女 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 11:08

    There are a much faster functions that do very similar things:

    x / (1 + abs(x)) – fast replacement for TAHN

    And similarly:

    x / (2 + 2 * abs(x)) + 0.5 - fast replacement for SIGMOID

    Compare plots with actual sigmoid

提交回复
热议问题