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
# to be used in conjunction with the functions defined here: | |
# https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/biggan_generation_with_tf_hub.ipynb | |
# party parrot transformation | |
noise_seed_A = 3 # right facing | |
noise_seed_B = 31 # left facing | |
num_interps = 14 | |
truncation = 0.2 | |
category = 14 |
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 matplotlib.pyplot as plt | |
def mk_data(true_theta, noise_sd, N_data_points, data_mean, data_sd): | |
data_x = np.expand_dims(np.random.randn(N_data_points)*data_sd + data_mean,axis=1) | |
data_y = np.zeros(data_x.shape) | |
for k in range(data_y.shape[0]): | |
data_y[k,0] = np.expand_dims(np.array([f(data_x[k,0],true_theta)]),axis=1) + np.random.randn(1)*noise_sd | |
data = np.concatenate([data_x,data_y],axis=1) | |
return data |