# 6 = Charizard
chosen_pokemon_2 = 9  # Squirtle
# chosen_pokemon_2 = 13  # Caterpie
chosen_pokemon = 30  # Pikachu
chosen_pokemon = 146  # Jolteon
# chosen_pokemon = 161  # Dragonite
# chosen_pokemon_2 = 252  # Porygon 2
# chosen_pokemon_2 = 330  # Aaron
# chosen_pokemon = 427  # Jirachi
# chosen_pokemon_2 = 622  # Darmanitan
# chosen_pokemon = 972  # shield doggo.
interpolation_intervals = 7

X_full_HSV, Y_full_HSV = \
    utilities.prepare_dataset_for_input_layer("pokedataset32_full_HSV_Two_Hot_Encoded.h5")

Y_full_HSV = Y_full_HSV * 0.5
expanded_full_X_HSV = np.append(X_full_HSV, Y_full_HSV, axis=1)

print("getting network to load model*******************")
network_instance = utilities.get_network()

network_instance = tflearn.regression(
    network_instance,
    optimizer='adam',
    metric='R2',
    loss=utilities.vae_loss,
    learning_rate=0.00001)  # adagrad? #adadelta #nesterov did good,
model = tflearn.DNN(network_instance)
print("LOADING MODEL.")
Пример #2
0
import tflearn
import h5py
import pokedataset32_vae_functions as utilities
from PIL import Image
import colorsys

# current_dataset = 'pokedataset'
current_dataset = 'anime_faces_'

use_anime_with_types = True
if not use_anime_with_types:
    X_full_HSV, Y_full_HSV, X_full_RGB, Y_full_RGB, X, Y, test_X, test_Y = utilities.ready_all_data_sets(
        current_dataset)
else:
    X, Y = utilities.prepare_dataset_for_input_layer(
        'anime_faces_32_train_HSV_Two_Hot_Encoded_Augmented_With_Types.h5',
        in_dataset_x_label='anime_faces_32_X',
        in_dataset_y_label='anime_faces_32_Y')
    test_X, test_Y = utilities.prepare_dataset_for_input_layer(
        'anime_faces_32_train_HSV_Two_Hot_Encoded_Augmented_With_Types.h5',
        in_dataset_x_label='anime_faces_32_X_test',
        in_dataset_y_label='anime_faces_32_Y_test')
    X_full_RGB, Y_full_RGB = utilities.prepare_dataset_for_input_layer(
        'anime_faces_32_full_RGB_Two_Hot_Encoded.h5',
        in_dataset_x_label='anime_faces_32_X',
        in_dataset_y_label='anime_faces_32_Y')

    X_first_half = X[0:int(len(X) / 2)]
    Y_first_half = Y[0:int(len(Y) / 2)]
    test_X_first_half = test_X[0:int(len(test_X) / 2)]
    test_Y_first_half = test_Y[0:int(len(test_Y) / 2)]
    """X_second_half = X[int(len(X) / 2):]
import h5py
import pokedataset32_vae_functions as utilities
from PIL import Image
import colorsys
import math

# current_dataset = 'pokedataset'
# current_dataset = 'anime_faces_'

# We don't need all of those.
# X_full_HSV, Y_full_HSV, X_full_RGB, Y_full_RGB, X, Y, test_X, test_Y = utilities.ready_all_data_sets(current_dataset)

# X_full_HSV, Y_full_HSV = utilities.prepare_dataset_for_input_layer('pokedataset32_full_HSV_Two_Hot_Encoded.h5')

X_full_HSV, Y_full_HSV = utilities.prepare_dataset_for_input_layer(
    'pokedataset32_full_HSV_Two_Hot_Encoded.h5',
    in_dataset_x_label='pokedataset32_X',
    in_dataset_y_label='pokedataset32_Y')

# """
X_full_HSV_faces, Y_full_HSV_faces = utilities.prepare_dataset_for_input_layer(
    'anime_faces_32_train_HSV_Two_Hot_Encoded_Augmented.h5',
    in_dataset_x_label='anime_faces_32_X',
    in_dataset_y_label='anime_faces_32_Y')

X_test_HSV_faces, Y_test_HSV_faces = utilities.prepare_dataset_for_input_layer(
    'anime_faces_32_train_HSV_Two_Hot_Encoded_Augmented.h5',
    in_dataset_x_label='anime_faces_32_X_test',
    in_dataset_y_label='anime_faces_32_Y_test')
# """
"""
# FOR DEBUGGING PURPOSES:
Пример #4
0
import numpy as np
import tensorflow as tf
import tflearn
import matplotlib.colors
import pokedataset32_vae_functions as utilities

current_dataset = 'pokedataset'
# current_dataset = 'anime_faces_'

# X and Y are not used in this file.
X_full_HSV, Y_full_HSV, X_full_RGB, Y_full_RGB, X, Y, test_X, test_Y = utilities.ready_all_data_sets(
    current_dataset)

X_full_HSV_regional, Y_full_HSV_regional = \
    utilities.prepare_dataset_for_input_layer("pokedataset32_full_HSV_Two_Hot_Encoded_Regional.h5")
Y_full_HSV_regional = Y_full_HSV_regional * 0.5
expanded_full_X_HSV_regional = np.append(X_full_HSV_regional,
                                         Y_full_HSV_regional,
                                         axis=1)
X_full_RGB_regional, Y_full_RGB_regional = \
    utilities.prepare_dataset_for_input_layer("pokedataset32_full_RGB_Two_Hot_Encoded_Regional.h5")
Y_full_RGB_regional = Y_full_HSV_regional * 0.5
expanded_full_X_RGB_regional = np.append(X_full_HSV_regional,
                                         Y_full_HSV_regional,
                                         axis=1)

Y_full_HSV = Y_full_HSV * 0.50
small_X = np.concatenate((X[0:200], test_X[0:200]), axis=0)
small_Y = np.concatenate((Y[0:200], test_Y[0:200]), axis=0)
len_X_div_2 = int(len(X) / 2)
Пример #5
0
from __future__ import division, print_function, absolute_import

import numpy as np
import tensorflow as tf
import tflearn
import matplotlib.pyplot as plt
import matplotlib.colors
import pokedataset32_vae_functions as utilities

X_full_HSV_Type_Swapped, Y_full_HSV_Type_Swapped = \
    utilities.prepare_dataset_for_input_layer('pokedataset32_full_HSV_Two_Hot_Encoded_Type_Swapped.h5')

X_full_RGB_Type_Swapped, Y_full_RGB_Type_Swapped = \
    utilities.prepare_dataset_for_input_layer('pokedataset32_full_RGB_Two_Hot_Encoded_Type_Swapped.h5')

Y_full_HSV_Type_Swapped = np.reshape(np.asarray(Y_full_HSV_Type_Swapped),
                                     newshape=[Y_full_HSV_Type_Swapped.shape[0], utilities.pokemon_types_dim])

expanded_full_X_HSV_Type_Swapped = np.append(X_full_HSV_Type_Swapped, Y_full_HSV_Type_Swapped, axis=1)

print("getting network to load model*******************")
network_instance = utilities.get_network()

network_instance = tflearn.regression(network_instance,
                                      optimizer='adam',
                                      # optimizer='rmsprop',
                                      metric='R2',
                                      # loss='mean_square',
                                      loss=utilities.vae_loss,
                                      learning_rate=0.001)  # adagrad? #adadelta #nesterov did good,