Skip to content

Instantly share code, notes, and snippets.

View dakl's full-sized avatar
💌
ML Engineer @ Epidemic Sound

Daniel Klevebring dakl

💌
ML Engineer @ Epidemic Sound
  • Epidemic Sound
  • Stockholm
View GitHub Profile
@dakl
dakl / tensorboard_logging.py
Created December 20, 2017 14:16 — forked from gyglim/tensorboard_logging.py
Logging to tensorboard with manually generated summaries (not relying on summary ops)
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: Copyleft
"""
__author__ = "Michael Gygli"
import tensorflow as tf
from StringIO import StringIO
import matplotlib.pyplot as plt
import numpy as np
@HD VN:1.4 SO:coordinate
@SQ SN:chrM LN:16571
@SQ SN:chr1 LN:249250621
@SQ SN:chr2 LN:243199373
@SQ SN:chr3 LN:198022430
@SQ SN:chr4 LN:191154276
@SQ SN:chr5 LN:180915260
@SQ SN:chr6 LN:171115067
@SQ SN:chr7 LN:159138663
@SQ SN:chr8 LN:146364022
# This function sorts the matrix for better visualization of mutual exclusivity across genes
memoSort <- function(M) {
geneOrder <- sort(rowSums(M), decreasing=TRUE, index.return=TRUE)$ix;
scoreCol <- function(x) {
score <- 0;
for(i in 1:length(x)) {
if(x[i]) {
score <- score + 2^(length(x)-i);
}
}
@dakl
dakl / memusg
Created February 18, 2013 08:37 — forked from netj/memusg
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
set -um
# check input
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; }