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 scipy.io | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
from tensorflow.examples.tutorials.mnist import input_data | |
%matplotlib inline | |
print ("PACKAGES LOADED") | |
mnist = input_data.read_data_sets('data/', one_hot=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
dim_hidden = 6 | |
dim_mapping = 6 | |
def mapping(feat, is_training=True, reuse=False): | |
batch_norm_params = {'is_training': is_training, 'decay': 0.9, 'updates_collections': None} | |
with tf.variable_scope("mapping") as scope: | |
if reuse: | |
scope.reuse_variables() | |
net = slim.fully_connected(feat, dim_hidden | |
, activation_fn = tf.nn.tanh # tf.nn.sigmoid | |
, weights_initializer = tf.truncated_normal_initializer(stddev=0.01) |
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 tensorflow as tf | |
import tensorflow.contrib.slim as slim | |
def mapping(feat, is_training=True, reuse=False): | |
batch_norm_params = {'is_training': is_training, 'decay': 0.9, 'updates_collections': None} | |
with tf.variable_scope("mapping") as scope: | |
if reuse: | |
scope.reuse_variables() | |
net = slim.fully_connected(feat, 16 |
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 | |
import tensorflow.contrib.slim as slim | |
from tensorflow.python.framework import ops | |
from tensorflow.examples.tutorials.mnist import input_data | |
import numpy as np | |
import cPickle as pkl | |
from sklearn.manifold import TSNE | |
import matplotlib.pyplot as plt | |
import urllib | |
import os |
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
NHIDDEN = 50 | |
STDEV = 0.1 | |
KMIX = 20 # NUMBER OF MIXTURES | |
NOUT = KMIX * 3 # PI / MU / STD | |
x = tf.placeholder(dtype=tf.float32, shape=[None,1], name="x") | |
y = tf.placeholder(dtype=tf.float32, shape=[None,1], name="y") | |
Wmdn = { | |
"l1": tf.Variable(tf.random_normal([1,NHIDDEN], stddev=STDEV, dtype=tf.float32)), |
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 math | |
import scipy.io | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib.ticker import LinearLocator, FormatStrFormatter | |
import tensorflow as tf | |
# PLOT3 IN PYTHON | |
def plot3(a, b, c, mark=".", col="b", title=""): |
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
from datetime import datetime | |
tic_total = datetime.now() | |
tic = datetime.now() | |
print ("START") | |
while True: | |
toc_total = (datetime.now()-tic_total).total_seconds() | |
toc = (datetime.now()-tic).total_seconds() | |
tic = datetime.now() | |
if toc > 0.1: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer