Skip to content

Instantly share code, notes, and snippets.

Avatar

Olivier Grisel ogrisel

View GitHub Profile
View numpy_test_log.txt
___________________________________________ TestUfuncGenericLoops.test_unary_PyUFunc_O_O_method_full[reciprocal] ____________________________________________
self = <numpy.core.tests.test_ufunc.TestUfuncGenericLoops object at 0x15b5324f0>, ufunc = <ufunc 'reciprocal'>
@pytest.mark.parametrize("ufunc", UNARY_OBJECT_UFUNCS)
def test_unary_PyUFunc_O_O_method_full(self, ufunc):
"""Compare the result of the object loop with non-object one"""
val = np.float64(np.pi/4)
class MyFloat(np.float64):
View numpy_build_log.txt
Running from numpy source directory.
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_philox.pyx
Processing numpy/random/_bounded_integers.pyx.in
Processing numpy/random/_sfc64.pyx
Processing numpy/random/_mt19937.pyx
Processing numpy/random/bit_generator.pyx
Processing numpy/random/mtrand.pyx
Processing numpy/random/_generator.pyx
Processing numpy/random/_pcg64.pyx
View ridge_normalize_false.py
# %%
import numpy as np
from numpy.random import sample
from numpy.testing import assert_allclose
from sklearn.preprocessing import scale
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from scipy.optimize import fmin_l_bfgs_b, check_grad
View weighted_variance_stability.py
import numpy as np
from sklearn.utils.extmath import _incremental_mean_and_var
from sklearn.utils.sparsefuncs import _incr_mean_var_axis0
from sklearn.utils.sparsefuncs import _csc_mean_var_axis0
from sklearn.utils.sparsefuncs import _csr_mean_var_axis0
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
for dtype in [np.float64, np.float32]:
print(f"## dtype={dtype.__name__}")
View compare_ridge.py
# %%
import numpy as np
from numpy.testing import assert_allclose
from sklearn.linear_model import Ridge
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from scipy.optimize import fmin_l_bfgs_b, check_grad
np.random.seed(0)
View eval_kmeans.py
# %%
from time import perf_counter
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from sklearn.cluster import MiniBatchKMeans
from sklearn.cluster import kmeans_plusplus
from sklearn.model_selection import train_test_split
from scipy.spatial.distance import cdist
from subprocess import run
from pprint import pprint
View numpy_macos_arm64_test.log
NumPy version 0.3.0+24607.gd075ba2ce
NumPy relaxed strides checking option: True
NumPy CPU features: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP? ASIMDDP?
........................................................................ [ 0%]
......................................................x................. [ 1%]
........................................................................ [ 1%]
................................................x....................... [ 2%]
........................................................................ [ 2%]
........................................................................ [ 3%]
........................................................................ [ 3%]
@ogrisel
ogrisel / bench_blas_lapack.py
Created Jan 31, 2021
Running some benchmark of BLAS level 3 and LAPACK on Apple M1
View bench_blas_lapack.py
import numpy as np
try:
import tensorflow as tf
except ImportError:
tf = None
from time import perf_counter
def timeit(func, *args, **kwargs):
durations = []
@ogrisel
ogrisel / numpy_openblas_test.log
Last active Feb 1, 2021
Update tests results for numpy 1.20.0 from conda-forge with openblas on Apple M1 (macos/arm64)
View numpy_openblas_test.log
NumPy version 1.20.0
NumPy relaxed strides checking option: True
NumPy CPU features: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP? ASIMDDP?
........................................................................ [ 0%]
......................................................x................. [ 1%]
........................................................................ [ 1%]
.................................x...................................... [ 2%]
........................................................................ [ 2%]
..........................sssssssss..................................... [ 3%]
........................................................................ [ 4%]
View arm64_bug.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "cblas.h"
int main() {
int found_error;
int k;