Skip to content

Instantly share code, notes, and snippets.

View HaveF's full-sized avatar
🎯
Focusing

HaveF HaveF

🎯
Focusing
View GitHub Profile
@HaveF
HaveF / 1nn.m
Created April 12, 2013 03:00
1nn -- pure matlab
% ... Xtrain/Xtest/ytrain/ytest/ntest/
tic
% sum of squares term for speed
XtrainSOS = sum(Xtrain.^2,2);
XtestSOS = sum(Xtest.^2,2);
ypred = zeros(ntest,1);
% Classify
dst = sqDistance(Xtest(:,:),Xtrain,XtestSOS(:,:),XtrainSOS);
[~,closest] = min(dst,[],2);
@HaveF
HaveF / check_blas log
Created May 14, 2013 01:16
theano.misc.check_blas.test()
>>> import theano.misc.check_blas
>>> theano.misc.check_blas.test()
Some Theano flags:
blas.ldflags= -lopenblas
compiledir= R:\compiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_58_S
tepping_9_GenuineIntel-2.7.3-64
floatX= float64
device= cpu
Some environment variables:
MKL_NUM_THREADS= None
@HaveF
HaveF / python theano-nose --batch log
Created May 14, 2013 01:32
python theano-nose --batch
D:\OpenCourses\ufldl\ref\Theano\bin>python theano-nose --batch
Forcing DISTUTILS_USE_SDK=1
WARNING (theano.tensor.blas): Failed to import scipy.linalg.blas. Falling back o
n slower implementations (DLL load failed: 找不到指定的模块。)
####################
# COLLECTING TESTS #
####################
WARNING (theano.tensor.blas): Failed to import scipy.linalg.blas. Falling back o
n slower implementations (DLL load failed: 找不到指定的模块。)
import numpy
import random
from numpy import arange
#from classification import *
from sklearn import metrics
from sklearn.datasets import fetch_mldata
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import shuffle
import time
@HaveF
HaveF / theano.misc.check_blas.test()
Created May 14, 2013 12:22
after set library path: blas.ldflags= -LC:\Anaconda\MinGW\lib -lopenblas
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-8811626b82bb> in <module>()
----> 1 theano.misc.check_blas.test()
D:\OpenCourses\ufldl\ref\Theano\theano\misc\check_blas.pyc in test()
110
111 def test():
--> 112 execute()
113
@HaveF
HaveF / check_blas.py
Created May 14, 2013 12:29
check_blas.py
D:\OpenCourses\ufldl\ref\Theano\theano\misc>python check_blas.py
Forcing DISTUTILS_USE_SDK=1
WARNING (theano.tensor.blas): Failed to import scipy.linalg.blas. Falling back o
n slower implementations (DLL load failed: 找不到指定的模块。)
Some results that you can compare against. They were 10 executions
of gemm in float64 with matrices of shape 2000x2000 (M=N=K=2000).
All memory layout was in C order.
CPU tested: Xeon E5345(2.33Ghz, 8M L2 cache, 1333Mhz FSB),
@HaveF
HaveF / error
Created May 14, 2013 12:47
blas.ldflags= -LC:\Anaconda\MinGW\x86_64-w64-mingw32\lib
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-8811626b82bb> in <module>()
----> 1 theano.misc.check_blas.test()
D:\OpenCourses\ufldl\ref\Theano\theano\misc\check_blas.pyc in test()
110
111 def test():
--> 112 execute()
var express = require('express');
var app = express.createServer(express.logger());
app.get('/', function(request, response) {
response.send('Hello World!');
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
@HaveF
HaveF / youtube_sub
Created November 11, 2014 09:55
Youtube Subtitle Downloader
// ==UserScript==
// @name Youtube Subtitle Downloader
// @include http://*youtube.com/watch*
// @include https://*youtube.com/watch*
// @author Tim Smart
// @copyright 2009 Tim Smart; 2011 gw111zz; 2013 Cheng Zheng;
// @license GNU GPL v3.0 or later. http://www.gnu.org/copyleft/gpl.html
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 0.0.1.20140930025401
// @namespace https://greasyfork.org/users/5711
@HaveF
HaveF / gulpfile.js
Last active November 19, 2015 10:01 — forked from cgmartin/gulpfile.js
Node ES6 istanbul, isparta, mocha-co gulpfile example
'use strict';
var gulp = require('gulp');
var del = require('del');
var mocha = require('gulp-mocha-co');
var istanbul = require('gulp-istanbul');
var isparta = require('isparta');
var coverageEnforcer = require('gulp-istanbul-enforcer');
var paths = {
server: {