Skip to content

an implementation of tripletloss for keras (with tensorflow backend)

License

Notifications You must be signed in to change notification settings

AtsushiHashimoto/keras_tripletloss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

keras_tripletloss

an implementation of tripletloss for keras (with tensorflow backend)

usage

...
from triplet_generator import TripletGenerator, make_triplet_loss_func, bpr_triplet_loss

...
datagen = ImageDataGenerator(
    featurewise_center=True,
    featurewise_std_normalization=True,
    rotation_range=20,
    width_shift_range=0.2,
    height_shift_range=0.2,
    horizontal_flip=True)
model4triplet = Model(inputs=[samples], outputs=[submodel])
tri_gen = TripletGenerator(datagen.flow(X_train,y_train, batch_size=base_batch_size), model4triplet)
...
model.fit_generator(tri_gen.triplet_flow(batch_size),
                    steps_per_epoch=steps_per_epoch,
                    validation_data=val_gen,
                    validation_steps=vsteps, 
                    epochs=epochs)
...

contribution

  • Any contribution (bug report, advice, rewrited code, etc) is welcome and help me a lot.
  • It is not confirmed that the code reproduce the original paper result or not.
  • English, Deutsch, and 日本語 OK.

original implementation

https://github.com/davidsandberg/facenet

About

an implementation of tripletloss for keras (with tensorflow backend)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published