This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://github.com/wzell/mann/blob/master/models/maximum_mean_discrepancy.py | |
# that didn't work for me on tensorflow | |
import tensorflow as tf | |
def gaussian_kernel(x1, x2, beta = 1.0): | |
r = tf.transpose(x1) | |
r = tf.expand_dims(r, 2) | |
return tf.reduce_sum(K.exp( -beta * K.square(r - x2)), axis=-1) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import base64 | |
import json | |
import fileinput | |
for jwt in fileinput.input(): | |
parts = jwt.split(".") | |
# '==' is padding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# takes text on stdin and stores it in the clipboard | |
# depends on gtk (i.e. a gnome desktop or something alike) | |
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import Gtk, Gdk | |
import fileinput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import json | |
import os | |
import math | |
import sys | |
def human_readable_size(size_bytes): | |
"""Convert bytes to human-readable file size.""" |
OlderNewer