Interpolation in the text-embedding space

These experiments perform linear interpolation in the text-embedding space. In a similar way to the previous experiment, we do this by sampling two text-embedding vectors, which are represented as points in a multidimensional space. We interpolate between them by linearly going from one point to another in N steps. 

The following code block is used for inference with interpolation in the text-embedding space:

def infer(data_filepath='data/flowers.hdf5', z_dim=128, out_dir='gan',          n_steps=10):    # we 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, 2))     # sample ...

Get Hands-On Generative Adversarial Networks with Keras now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.