May 2019
Intermediate to advanced
272 pages
7h 19m
English
Arithmetic in the embedding space is another fascinating aspect of some generative models. In vector arithmetic in embedding spaces, the elementary mathematical operations, such as add or subtract, are closely related to adding properties described in two vectors or subtracting a property described in one vector from the other. For example, adding text vectors that describe orange and yellow flowers, respectively, can result in flowers that have both colors.
The following code block was used to perform vector arithmetic in the text-embedding space:
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) # load ...
Read now
Unlock full access