This file contains 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
import tensorflow as tf | |
ReduceMean = lambda axis=1: tf.keras.layers.Lambda(lambda x: tf.reduce_mean(x, axis=axis)) | |
i = tf.keras.layers.Input(shape=(5,15)) # shape: [BATCHSIZE, 5, 15] | |
m = ReduceMean(i) # shape: [BATCHSIZE, 15] | |
# TODO would be nice to have a wrapping function for any TF op with arbitrary |
This file contains 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
# ln -s /path/to/this/.autoenv.sh /path/to/workdir/ | |
if test -f .autoenv_conda_env_name ; then | |
TARGET_CONDA_ENV="$(cat .autoenv_conda_env_name)" | |
if [[ $TARGET_CONDA_ENV != $CONDA_DEFAULT_ENV ]]; then | |
conda activate "$TARGET_CONDA_ENV" 2&>1 2> /dev/null | |
fi | |
else | |
CUR_DIR=$(basename $(pwd)) | |
conda activate "$CUR_DIR-dev" 2> /dev/null \ |
This file contains 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
def perfboxplot( | |
setup, | |
kernels, | |
labels, | |
n=3, | |
xlabel="Performances", | |
equality_check=None, | |
save_path=None, | |
log_scale=True, | |
): |
This file contains 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
import numpy as np | |
import pandas as pd | |
import seaborn as sbn | |
from matplotlib import pyplot as plt | |
from scipy.stats import anderson | |
from sklearn import datasets | |
from sklearn.cluster import MiniBatchKMeans | |
from sklearn.preprocessing import scale, LabelEncoder | |
# TODO doc, memoization |
This file contains 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
[user] | |
name = Keuv Grvl | |
email = k***@***m | |
[core] | |
quotepath = false | |
editor = vim | |
pager = less -F -x2 | |
[init] | |
defaultBranch = main | |
[push] |
This file contains 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
class FItSNE_wrapper: | |
""" | |
Wrapper class for FItSNE `fast_tsne.fast_tsne` v1.1.0. | |
It is currently designed to work in a Conda environment with Python 3.7 and FFTW 3. | |
Install and compile as follow: | |
$ conda create -n YOUR-ENV python=3.7 fftw=3 | |
$ source activate YOUR-ENV |
This file contains 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
.PHONY: pdf display clean nuke | |
PDFREADER :=evince | |
OUTPUT :=document.pdf | |
BUILD :=build | |
SRC :=$(shell find src -name '*.tex' -o -name '*.png') | |
LMKFLAGS = -pdf -outdir=$(BUILD) | |
pdf: $(OUTPUT) |
This file contains 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 argparse | |
import gzip | |
import logging | |
import sys | |
from time import time | |
from lxml import etree |
This file contains 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 bash | |
# usage: toggle-vpn.sh vpn-name | |
set -e # this script exits on error | |
set -o pipefail # a pipeline returns error code if any command fails | |
set -u # unset variables as an error, and immediately exit | |
command -v nmcli > /dev/null # ensure nmcli is installed |
This file contains 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 bash | |
docker run \ | |
--volume $(pwd):/data \ | |
--user $(id -u $USER):$(id -g $USER) \ | |
--entrypoint /path/to/your_program \ | |
CONTAINER_NAME \ | |
--input /data/inputfile --output /data/outputfile | |
# Will run '/path/to/your_program --input /data/inputfile --output /data/output' inside the container, |