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
| # 2D -> 3D bottleneck architecture | |
| import tensorflow as tf | |
| layers = tf.contrib.slim.layers | |
| # Network inputs | |
| x_in = tf.placeholder(tf.float32, shape=(None, 64, 64, 3)) | |
| y_in = tf.placeholder(tf.float32, shape=(None, 32, 32, 32, 1)) | |
| phase = tf.placeholder(tf.bool) # for batch norm - see http://ruishu.io/2016/12/27/batchnorm/ |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| class MinibatchDiscrimination(lasagne.layers.Layer): | |
| ''' | |
| A lasagne layer to perform minibatch discrimination [1]. The idea is to improve | |
| generative advesarial networks (GANs) by appending a feature to each input example | |
| which takes information from all the other items in the minibatch. | |
| This means that the generator, when it comes to creating a new minibatch, is less | |
| likely to fixate on one point. Instead it should be incentivised to generate | |
| examples covering the full output space. | |
| Notation and formulation as described in [1], section 3.2 |
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/python | |
| # Script which prints statistics about number of lines from all the files | |
| # recursively below the current folder. | |
| # Currently just looks at .py and .ipynb files, but could be trivially modified | |
| # to look at other file types. | |
| # Caveat: Includes comments, blank lines etc in the count. | |
| # Bash solution: | |
| # #! /bin/sh | |
| # find . -name '*.py' | xargs wc -l |
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
| import numpy as np | |
| import scipy | |
| def savemat_large(savepath, dic, modify_in_place=True, **kwargs): | |
| """ | |
| Save a python dictionaries containing arbitrarily large numpy arrays. | |
| Essentially a wrapper for scipy.io.savemat, but first numpy arrays which | |
| are too large are split up. | |
| This is a hacky fix for the problem that individual objects bigger than |
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
| # https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/ | |
| git pull https://github.com/groakat/engaged_hackathon.git master |