Ejemplo n.º 1
0
import parametric_tSNE
import my_utils
from matplotlib import pyplot as plt
from tensorflow.contrib.keras import layers

all_layers = [
    layers.Dense(500,
                 input_shape=(784, ),
                 activation='relu',
                 kernel_initializer='glorot_uniform'),
    layers.Dense(500, activation='relu', kernel_initializer='glorot_uniform'),
    layers.Dense(2000, activation='relu', kernel_initializer='glorot_uniform'),
    layers.Dense(10, activation='linear', kernel_initializer='glorot_uniform')
]

test_data_list, numPerClass = my_utils.getTest_data(numPerClass=100,
                                                    reshape=False)
colors = [
    'blue', 'green', 'red', 'cyan', 'magenta', 'yellow', 'black', 'purple',
    'pink', 'brown'
]
#             0       1       2       3        4          5        6        7         8       9

X, Y = my_utils.load_data('mnist')
high_dims = 784
num_outputs = 10
perplexity = 30
num_data = 20000
ptSNE = parametric_tSNE.Parametric_tSNE(high_dims,
                                        num_outputs,
                                        perplexity,
                                        do_pretrain=False,
Ejemplo n.º 2
0
n_critic = 1  #
n_generator = 1
gan_type = "dec-mad-fix"
dir = "results/" + gan_type + "-" + datetime.datetime.now().strftime(
    "%Y%m%d-%H%M%S")
tf.set_random_seed(1234)
''' data '''
data_pool = my_utils.getFullMNISTDatapool(batch_size,
                                          shift=False)  #range 0 ~ 1
# data_pool = my_utils.getFullFashion_MNISTDatapool(batch_size, shift=False)
# X,Y = my_utils.loadFullFashion_MNSIT(shift=False)
X, Y = my_utils.load_data('mnist')
X = np.reshape(X, [70000, 28, 28, 1])
num_data = 70000
plt.ion()  # enables interactive mode
test_data_list, numPerClass = my_utils.getTest_data(numPerClass=100)
colors = [
    'blue', 'green', 'red', 'cyan', 'magenta', 'yellow', 'black', 'purple',
    'pink', 'brown'
]
#             0       1       2       3        4          5        6        7         8       9
# from tensorflow.examples.tutorials.mnist import input_data
# mnist = input_data.read_data_sets("MNIST_data/", one_hot=False)
""" graphs """
encoder = partial(models.encoder, z_dim=z_dim)
decoder = models.decoder
num_heads = 1
generator = partial(models.generator_m, heads=num_heads)
discriminator = models.ss_discriminator
sampleing = models.sampleing
optimizer = tf.train.AdamOptimizer