Skip to content

Instantly share code, notes, and snippets.

@akash-ch2812
Created July 24, 2020 08:20
Show Gist options
  • Save akash-ch2812/d5406ba9c7fac3812aaa0abd85126d22 to your computer and use it in GitHub Desktop.
Save akash-ch2812/d5406ba9c7fac3812aaa0abd85126d22 to your computer and use it in GitHub Desktop.
# get training data
train_data = create_trianing_data(train_image_captions, train_image_features, tokenizer, max_caption_len, vocab_length, 32)
# initialize model
model = create_model(max_caption_len, vocab_len)
steps_per_epochs = len(train_image_captions)//32
# compile model
model.compile(optimizer='adam', loss='categorical_crossentropy')
model.fit_generator(train_data, epochs=100, steps_per_epoch=steps_per_epochs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment