{{ message }}

Instantly share code, notes, and snippets.

🏠
Working from home

🏠
Working from home
• Paris, France
Created Jun 8, 2020
Comparison of distance functions on covariance matrices
View riemann_euclid_plot.py
 from functools import partial import matplotlib.pyplot as plt import numpy as np from pyriemann.utils.distance import distance_riemann @partial(np.vectorize, excluded=['ref']) def distance_riemann_v(c_xx, c_yy, ref): """ Vectorized version of distance_riemann projected in 2D
Created Feb 17, 2019
Example OpenAPI specification for inline model bug reproduction
View openapi.yaml
 openapi: "3.0.0" info: version: 1.0.0 title: Swagger Petstore license: name: MIT servers: - url: http://petstore.swagger.io/v1 paths: /pets:
Last active Mar 22, 2018
Epoching of 2D array on its last dimension using a view (not a copy)
View epoching.py
 """ Small proof of concept of an epoching function using NumPy strides License: BSD-3-Clause Copyright: David Ojeda , 2018 """ import numpy as np from numpy.lib import stride_tricks
Created Aug 5, 2016
View eigen_mwe.cpp
 #include #include #include int main(int argc, char *argv[]) { Eigen::MatrixXd X = Eigen::MatrixXd::Random(3, 3); // PCA = EVD of the covariance matrix Eigen::SelfAdjointEigenSolver < Eigen::MatrixXd > solver(X.selfadjointView());
Created Apr 15, 2015
TIL about trigraphs in C and C++. Wat the fk!
View trigraphs-c++
 #include #include #include using namespace std; int main(int , char *[]) { vector v1 = {0,1,2};
Last active Aug 29, 2015
View square root 2
 #!/usr/bin/env python def sqrt(x): begin = 0 end = x while begin <= end: mid = begin + (end - begin) // 2
You can’t perform that action at this time.