Skip to content

Instantly share code, notes, and snippets.

View gravitino's full-sized avatar
🎯
Focusing

Christian Hundt gravitino

🎯
Focusing
View GitHub Profile
nvidia-smi dmon -s pucvmt -o T
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gravitino
gravitino / mf.py
Created March 22, 2017 08:00
dense matrix factorization
import tensorflow as tf
import tqdm
def tfmf(D, k,
params_dict={"iters":2**14, "p":2, "h":1E-2, "init":"kmeans"},
regularizer_dict={"lambda_C":1E-3, "lambda_B":1E-3, "p":1}):
m, n = D.shape[0], D.shape[1]
D_con = tf.constant(D)
@gravitino
gravitino / oss.py
Created February 28, 2016 17:04
scalable spectral clustering using efficient out of sample extension by estimating the feature transform
import numpy as np
import pylab as pl
#import seaborn as sns
from sklearn.datasets import make_blobs, make_circles
def rbf_kernel(X, beta=None, p=2):
num_data, num_feat = X.shape
kernel = np.zeros((num_data, num_data))
@gravitino
gravitino / cuda_if.cu
Last active February 16, 2016 14:09
branch divergent-free if in CUDA considered harmful (benchmarked on Titan X)
#include <iostream>
// error makro
#define CUERR { \
cudaError_t err; \
if ((err = cudaGetLastError()) != cudaSuccess) { \
std::cout << "CUDA error: " << cudaGetErrorString(err) << " : " \
<< __FILE__ << ", line " << __LINE__ << std::endl; \
exit(1); \
} \