AVX gradients (#2878)

* AVX gradients

* Add google test for AVX

* Create fallback implementation, remove fma instruction

* Improved accuracy of AVX exp function
This commit is contained in:
Rory Mitchell
2017-11-27 08:56:01 +13:00
committed by GitHub
parent 3dcf966bc3
commit 24f527a1c0
7 changed files with 465 additions and 47 deletions

View File

@@ -11,6 +11,7 @@
#include <vector>
#include <cmath>
#include <algorithm>
#include "avx_helpers.h"
namespace xgboost {
namespace common {
@@ -23,6 +24,10 @@ inline float Sigmoid(float x) {
return 1.0f / (1.0f + std::exp(-x));
}
inline avx::Float8 Sigmoid(avx::Float8 x) {
return avx::Sigmoid(x);
}
/*!
* \brief do inplace softmax transformaton on p_rec
* \param p_rec the input/output vector of the values.