Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
arisliang committed Mar 18, 2018
1 parent bdba1de commit 1c7ee34
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions train_txt2im.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,16 @@ def main_train():
## seed for generation, z and sentence ids
sample_size = batch_size
sample_seed = np.random.normal(loc=0.0, scale=1.0, size=(sample_size, z_dim)).astype(np.float32)
# sample_seed = np.random.uniform(low=-1, high=1, size=(sample_size, z_dim)).astype(np.float32)
sample_sentence = ["the flower shown has yellow anther red pistil and bright red petals."] * int(sample_size/ni) + \
["this flower has petals that are yellow, white and purple and has dark lines"] * int(sample_size/ni) + \
["the petals on this flower are white with a yellow center"] * int(sample_size/ni) + \
["this flower has a lot of small round pink petals."] * int(sample_size/ni) + \
["this flower is orange in color, and has petals that are ruffled and rounded."] * int(sample_size/ni) + \
["the flower has yellow petals and the center of it is brown."] * int(sample_size/ni) + \
["this flower has petals that are blue and white."] * int(sample_size/ni) +\
["these white flowers have petals that start off white in color and end in a white towards the tips."] * int(sample_size/ni)
# sample_seed = np.random.uniform(low=-1, high=1, size=(sample_size, z_dim)).astype(np.float32)]
n = int(sample_size / ni)
sample_sentence = ["the flower shown has yellow anther red pistil and bright red petals."] * n + \
["this flower has petals that are yellow, white and purple and has dark lines"] * n + \
["the petals on this flower are white with a yellow center"] * n + \
["this flower has a lot of small round pink petals."] * n + \
["this flower is orange in color, and has petals that are ruffled and rounded."] * n + \
["the flower has yellow petals and the center of it is brown."] * n + \
["this flower has petals that are blue and white."] * n +\
["these white flowers have petals that start off white in color and end in a white towards the tips."] * n

# sample_sentence = captions_ids_test[0:sample_size]
for i, sentence in enumerate(sample_sentence):
Expand Down

0 comments on commit 1c7ee34

Please sign in to comment.