Skip to content

Instantly share code, notes, and snippets.

View jaekookang's full-sized avatar
🎯
Focusing

jkang jaekookang

🎯
Focusing
View GitHub Profile
@kmundnic
kmundnic / krippendorff_alpha.m
Last active May 9, 2019 15:24
Krippendorff's alpha in MATLAB
function alpha=kriAlpha(data,scale)
% alpha=kriAlpha(data,scale)
% calculates Krippendorff's Alpha as a measure of inter-rater agreement
% data: rate matrix, each row is a rater or coder, each column is a case
% scale: level of measurement, supported are 'nominal', 'ordinal', 'interval'
% missing values have to be coded as NaN or inf
% For details about Krippendorff's Alpha see:
% http://en.wikipedia.org/wiki/Krippendorff%27s_Alpha
% Hayes, Andrew F. & Krippendorff, Klaus (2007). Answering the call for a
@cshjin
cshjin / matfac.m
Last active September 27, 2019 02:23
Matrix factorization problem implemented in Tensorflow and Matlab (with yalmip)
yalmip('clear')
T = [0 1 0 1; 1 0 1 0; 0 1 0 1; 1 0 1 0];
x = sdpvar(4, 1);
y = sdpvar(4, 1);
assign(x, randn(4, 1));
assign(y, randn(4, 1));
const = [x'*x <= 1; y'*y <=1];
% const = [];
@Uberi
Uberi / realtime-plot.py
Created April 25, 2015 02:10
Realtime plotting with Matplotlib.
#!/usr/bin/env python3
import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
@Dref360
Dref360 / TFQueueKeras.py
Last active March 16, 2020 02:24
An example of using keras with tf queues, this handle BatchNorm
import operator
import threading
from functools import reduce
import keras
import keras.backend as K
from keras.engine import Model
import numpy as np
import tensorflow as tf
import time
def tf_pca(x):
'''
Compute PCA on the bottom two dimensions of x,
eg assuming dims = [..., observations, features]
'''
# Center
x -= tf.reduce_mean(x, -2, keepdims=True)
# Currently, the GPU implementation of SVD is awful.
# It is slower than moving data back to CPU to SVD there
@sconstantinides
sconstantinides / .bash_profile
Last active April 2, 2020 15:42
Simple bash profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\w\$(parse_git_branch) $ "
export EDITOR="atom -w"
export PATH=/usr/local/bin:$PATH
@huytd
huytd / d3_realtime_linechart.html
Created November 6, 2015 01:11
Realtime Line Chart with D3
<style>
.axis {
font-family: sans-serif;
fill: #d35400;
font-size: 12px;
}
.line {
fill: none;
@brunston
brunston / dash_css.css
Created September 29, 2017 07:56
Dash CSS (forked from https://codepen.io/chriddyp/pen/bWLwgP.css, based off Skeleton)
/* Table of contents
––––––––––––––––––––––––––––––––––––––––––––––––––
- Plotly.js
- Grid
- Base Styles
- Typography
- Links
- Buttons
- Forms
- Lists
@r9y9
r9y9 / download_cmu_arctic.sh
Last active January 5, 2021 11:07
CMU ARCTIC download script
#!/bin/bash
# This is a yet another download script for the cmu arctic speech corpus.
# The corpus will be downloaded in $HOME/data/cmu_arctic/
location=$HOME/data/cmu_arctic/
if [ ! -e $location ]
then
echo "Create " $location
@simecek
simecek / rmagic_example.ipynb
Last active January 16, 2021 13:29
How to add R code to your (IPython) Jupyter Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.