Skip to content

Instantly share code, notes, and snippets.

Kilian Batzner batzner

Block or report user

Report or block batzner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
"""Lists all e-mails for a given IMAP account, largest first. Can be useful when freeing up space.
Requires imapclient==2.1.0 and python3.6 or higher.
from collections import namedtuple
from email.header import decode_header
from imapclient import IMAPClient
batzner /
Created Jan 29, 2019
Python logging helper module
"""Helper module for logging.
Example Usage:
from log import get_logger, get_out_dir_of_logger
LOG = get_logger(__name__)'Logging to %s' % get_out_dir_of_logger(LOG))
'''Trains a simple convnet on the MNIST dataset with adversarial training.
During the adversarial train step's feed-forward pass, the dropout masks can be
reused by setting REUSE_DROPOUT to True
For more info, see
- tensorflow==1.12.0
- cleverhans bleeding edge: pip install git+
View santa_gift_matching.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef int bool;
#define true 1
#define false 0
const unsigned int N_CHILDREN = 1000000;
const unsigned int N_GIFT_PREF = 10;
batzner /
Last active Sep 13, 2019
Small python script to rename variables in a TensorFlow checkpoint
import sys, getopt
import tensorflow as tf
usage_str = 'python --checkpoint_dir=path/to/dir/ ' \
'--replace_from=substr --replace_to=substr --add_prefix=abc --dry_run'
def rename(checkpoint_dir, replace_from, replace_to, add_prefix, dry_run):
checkpoint = tf.train.get_checkpoint_state(checkpoint_dir)
You can’t perform that action at this time.