Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tripletloss, TripletCNN and further Tensorflow 2 support #2

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

verrannt
Copy link

Amongst others, this pull request adds

  • an online triplet loss incorporating class labels as well as data augmentation labels
  • a new network, TripletCNN, which serves as a baseline architecture for comparing configurations of the triplet loss
  • further Tensorflow 2 compatibility across a range of files
  • training an SVC on the invariance layers embeddings to check classification performance

Pascal Schröder added 20 commits June 30, 2020 12:57
del_mse_nodes() fails with TF2. This functionality should achieve the same end.
This is no guarantee that everything will work with TF2
triplet loss can be switched on or off with command line arguments
add shell script collecting invariance scores of different models for certain epochs
add shell script to collect test scores for specified models and epochs
add shell script to train the tripletcnn architecture as classifier without triplet loss on Cifar10
edit paths for more generality
Comment on lines -132 to +137
# Ensure the model has no MSE nodes and outputs
model = del_mse_nodes(model)
# Ensure the model has no MSE nodes and outputs by building a new model
# with the old models weights and only the softmax output
softmax_layers = [layer for layer in model.layers if layer.name=='softmax']
assert len(softmax_layers) == 1, 'Model has multiple softmax layers'
softmax_layer = softmax_layers[0]
model = Model(model.input, softmax_layer.output)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a partial fix, since it may not work with models with more complex connectivity.

In any case these lines should go on surgery.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants