May 2019
Intermediate to advanced
272 pages
7h 19m
English
We continue our experiments by performing linear interpolation in latent space. We do this by sampling two Z vectors, which are represented as points in a multidimensional space. We interpolate between then by linearly going from one point to another in steps. Let's take a look at the code for doing so:
def infer(data_filepath='data/flowers.hdf5', z_dim=128, out_dir='gan', n_steps=10): # load the saved model G = load_model(out_dir) # get text embeddings and text from the validation set val_data = get_data(data_filepath, 'train') val_data = next(iterate_minibatches(val_data, 1)) emb_fixed, txt_fixed = val_data[1], val_data[2] # sample two z vectors to mark our starting and ending z z_start = np.random.uniform(-1, ...
Read now
Unlock full access