Skip to content

Instantly share code, notes, and snippets.

@fanwei918
fanwei918 / Matrix.md
Created May 29, 2018 02:38 — forked from nadavrot/Matrix.md
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@fanwei918
fanwei918 / readme.md
Created November 29, 2017 19:35 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@fanwei918
fanwei918 / timeseries_cnn.py
Created November 28, 2017 16:30 — forked from jkleint/timeseries_cnn.py
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@fanwei918
fanwei918 / xgboost_to_c.py
Created November 23, 2017 18:04 — forked from raddy/xgboost_to_c.py
Convert XGBoost model to C header
import re
_comparer = None
import contextlib
#ALWAYS_INLINE = "__attribute__((__always_inline__))"
ALWAYS_INLINE = "ALWAYS_INLINE"
class CodeGenerator(object):
def __init__(self):
#/usr/bin/env python
import math
class RunningCorrelation:
def __init__(self):
self.n = 0.0
self.mean_x = 0.0
self.mean_y = 0.0
self.m2_x = 0.0
self.m2_y = 0.0
/*
A Minimal Capture Program
This program opens an audio interface for capture, configures it for
stereo, 16 bit, 44.1kHz, interleaved conventional read/write
access. Then its reads a chunk of random data from it, and exits. It
isn't meant to be a real program.
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html