Skip to content

Instantly share code, notes, and snippets.

@censored--
censored-- / benchmark.md
Created April 16, 2017 08:05
GPU benchmark by the chainer code in https://t.co/5eA66bVgio

GTX980 + Core i7 -6700K @ 4.00GHz + ubuntu 16.04 chainer

alexnet Average Forward: 51.7668122186 ms Average Backward: 122.44968462 ms Average Total: 174.216496838 ms

googlenet Average Forward: 234.798005846 ms

import theano.tensor as T
from theano import function
x = T.dscalar('x')
z = x**2
gz = T.grad(z, x)
f = function([x], gz)
print(f(12.2))
#!/bin/bash
python test.py -m "text message"
#!/bin/bash
python test.py -m "text message"
class SVM(object):
def __init__(self,n_in,c0=1,c1=1,loss = RAMP_LOSS,gamma = 0.5):
self.dim = n_in
self.w = np.zeros(n_in)
self.b = np.zeros(1)
self.c0 = c0
self.c1 = c1
self.gamma = gamma
self.x = None
self.y = None
#include <Eigen/Core>
#include <Eigen/Sparse>
using namespace std;
using namespace Eigen;
void sinitialize(VectorXd &s,double mu,unsigned int sizex,VectorXd &x)
{
for (unsigned int i=0;i<sizex;i++)
if (x[i]!=0)s[i] = mu/x[i];
else s[i]=0.1;
dot_globl :min_caml_read_int
label :min_caml_read_int
read at
sll at, at, 8
read at
sll at, at, 8
read at
sll at, at, 8
read at
add v0, at, zero
let rec create_2dmatrix a b c d =
let matrix = Array.create 2 (Array.create 0 0.0) in
matrix.(0)<-Array.create 2 0.0;
matrix.(1)<-Array.create 2 0.0;
let mx_0 = matrix.(0) in
mx_0.(0)<- a;
mx_0.(1)<- b;
let mx_1 = matrix.(1) in
mx_1.(0)<- c;
mx_1.(1)<- d;