Skip to content

Instantly share code, notes, and snippets.

View Cospel's full-sized avatar

Michal Lukac Cospel

View GitHub Profile
@Cospel
Cospel / tensorflow_rename_variables.py
Created April 13, 2018 12:06 — forked from batzner/tensorflow_rename_variables.py
Small python script to rename variables in a TensorFlow checkpoint
import sys, getopt
import tensorflow as tf
usage_str = 'python tensorflow_rename_variables.py --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)
@Cospel
Cospel / rbm_after_refactor.py
Created April 3, 2016 13:46 — forked from gabrieleangeletti/rbm_after_refactor.py
Restricted Boltzmann Machine implementation in TensorFlow, before and after code refactoring. Blog post: http://www.gabrieleangeletti.com/blog/programming/2016/02/21/refactoring-rbm-tensor-flow-implementation.html
import tensorflow as tf
import numpy as np
import os
import zconfig
import utils
class RBM(object):
@Cospel
Cospel / rbm_MNIST_test.py
Last active October 27, 2017 11:13 — forked from myme5261314/rbm_MNIST_test.py
RBM procedure using tensorflow
#http://blog.echen.me/2011/07/18/introduction-to-restricted-boltzmann-machines/
#https://www.tensorflow.org/versions/r0.7/api_docs/python/constant_op.html#random_uniform
import tensorflow as tf
import numpy as np
import input_data
import Image
from util import tile_raster_images