Coder Social home page Coder Social logo

juanmc2005 / similaritylearning Goto Github PK

View Code? Open in Web Editor NEW
10.0 6.0 7.0 5.94 MB

Similarity Learning applied to Speaker Verification and Semantic Textual Similarity

Python 100.00%
metric-learning similarity-learning arcface contrastive-loss triplet-loss center-loss speaker-verification sts semantic-textual-similarity mnist

similaritylearning's People

Contributors

juanmc2005 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

similaritylearning's Issues

Integrate STS Dataset

The dataset should be added with batch generation and loaders, so its access respects the same interface as MNIST.
Make sure to include the posibility to generate pairs, triplets or clusters.

Document Loss Functions

Not all loss functions are well documented. Explain them in detail, as it is the core of the project

Train Contrastive STS model

Determine a threshold to build positive and negative STS pairs and train a model with contrastive loss.
Validate with Spearman score (should discuss which is the best method).

EER Parallel Validation

Implement EER validation trials as a separate validation script to run in parallel every time a new model is saved.

Train First Speaker Verification Model

Use SpeakerModel and VoxCeleb1 to train a first speaker verification model.
Cross entropy takes priority over the rest of the losses as discussed in previous meetings.
Make sure to use EER as the validation metric.

Trainer Callbacks to Separate Files

base.py is starting to grow in size:

  • Base training classes should be moved to a single file in a "training" directory.
  • Subclasses of TrainingListener should be put in a training callbacks file
  • Subclasses of TestListener should be put in a test callbacks file
  • It could be cooler to name listeners "plugins" or something like that, since they feel to be more than just callbacks.

Further Refactor Trainers

Currently the trainers have more code in common than I'm confortable with. Try to make them as small as possible, without losing the needed flexibility

how to run

I want to know How to run the training code of MNIST dataset

Triplet STS experiment

Code and run a triplet loss experiment for STS.
We can focus on euclidean distance for now, so we test as many functions as we can. Later we'll do experiments with cosine distance too.

Integrate VoxCeleb

Get familiar with the VoxCeleb dataset (doc provided) and integrate it into the project. Make it available through an interface similar to the already available MNIST dataset.

ArcFace Speaker Experiment

Use ArcFace loss to train a speaker verification model. The SincNet softmax baseline should be used in order to reduce training time.

Model Saving

Automatically save the model when it achieves best validation performance.

Integrate STS Model

Add chosen STS model (provided) to the project. Make it available through an interface similar to the MNIST model.

STS Golden Rating plot

Plot the golden ratings in the dataset to understand their distribution and choose an adequate threshold

Integrate SV Model

Integrate the speaker verification model (provided) into the project. Make it available through an interface similar to the MNIST model.

STS Cluster Simulation

The code needed to cluster sentences based on positive pairs and a threshold already exists.

What's needed here is to simulate the generation of clusters for different threshold values (to consider positives).

To start, consider threshold values from 0 to 5 with a step of 0.5, then plot the amount of clusters generated, total sentences kept, and mean cluster size.
A zone of interest will come out of this experience, we have to zoom there and repeat the experience in this interval, with a step of 0.1.
After that, we have to choose a good threshold to generate clusters.

Note: Sentences which don't have positive relationships will be lost from the original dataset, as we cannot infer clusters for them, unless we allow clusters of 1 sentence.

STS Triplets

Using the information from #8, build positive and negative pairs using a threshold, and generate triplets with them.

Train Softmax STS model

Just adding this issue for completeness.
Training with softmax is possible, but a few details about the clusters will need to be verified before we can expect to have decent or comparable results.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.