diff options
author | Matti Picus <matti.picus@gmail.com> | 2020-04-23 08:14:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 08:14:09 +0300 |
commit | 96c21f037679c0766142fa8dc3fb143b5927439f (patch) | |
tree | b6185e2a51a673bf8bebb68038b962ccf3688824 /benchmarks | |
parent | 517f53dc91164f4249de9dbaf31be65df02ffde7 (diff) | |
parent | 6bd0cb90a607f46c6c45fbc36d280dd25e23b4a3 (diff) | |
download | numpy-96c21f037679c0766142fa8dc3fb143b5927439f.tar.gz |
Merge pull request #15648 from xiegengxin/avx512-exp-float64
MAINT: AVX512 implementation with intrinsic for float64 input np.exp()
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/benchmarks/bench_avx.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/benchmarks/benchmarks/bench_avx.py b/benchmarks/benchmarks/bench_avx.py index 224c12e33..2a128b3ff 100644 --- a/benchmarks/benchmarks/bench_avx.py +++ b/benchmarks/benchmarks/bench_avx.py @@ -131,6 +131,8 @@ class Mandelbrot(Benchmark): self.mandelbrot_set(-0.74877,-0.74872,0.06505,0.06510,1000,1000,2048) class LogisticRegression(Benchmark): + param_names = ['dtype'] + params = [np.float32, np.float64] timeout = 1000 def train(self, max_epoch): @@ -142,16 +144,16 @@ class LogisticRegression(Benchmark): dw = (1/self.size) * np.matmul(self.X_train.T, dz) self.W = self.W - self.alpha*dw - def setup(self): + def setup(self, dtype): np.random.seed(42) self.size = 250 features = 16 - self.X_train = np.float32(np.random.rand(self.size,features)) - self.Y_train = np.float32(np.random.choice(2,self.size)) + self.X_train = np.random.rand(self.size,features).astype(dtype) + self.Y_train = np.random.choice(2,self.size).astype(dtype) # Initialize weights - self.W = np.zeros((features,1), dtype=np.float32) - self.b = np.zeros((1,1), dtype=np.float32) + self.W = np.zeros((features,1), dtype=dtype) + self.b = np.zeros((1,1), dtype=dtype) self.alpha = 0.1 - def time_train(self): + def time_train(self, dtype): self.train(1000) |