QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.divhf.DivHFProjector Class Reference

Fit a linear descriptor with Bradley-Terry preference likelihoods. More...

Inheritance diagram for qdpy.algorithms.divhf.DivHFProjector:
qdpy.algorithms.qdhf.TripletProjector

Public Member Functions

 fit (self, raw_features, triplets, *, steps=128, batch_size=32, learning_rate=.01, seed=0)
Public Member Functions inherited from qdpy.algorithms.qdhf.TripletProjector
 transform (self, raw_features)
 Apply the same projection to one vector or a matrix of row vectors.

Detailed Description

Fit a linear descriptor with Bradley-Terry preference likelihoods.

Train on anchor, near, far index triples using log likelihood.

Two distinct pairs in a triplet share one anchor. Similarity is
negative squared Euclidean distance in the projected coordinates.
A small weight penalty regularizes otherwise separable comparisons.

:param raw_feature_size: Input width.
:param descriptor_size: Learned coordinate width.
:param temperature: Positive divisor for the difference in similarities.
:param regularization: Nonnegative squared-weight penalty.
:param seed: Initial projection seed.

Definition at line 25 of file divhf.py.

Member Function Documentation

◆ fit()

qdpy.algorithms.divhf.DivHFProjector.fit ( self,
raw_features,
triplets,
* ,
steps = 128,
batch_size = 32,
learning_rate = .01,
seed = 0 )
Fit probabilities for anchor, closer, farther labels by minimizing cross-entropy.

Reimplemented from qdpy.algorithms.qdhf.TripletProjector.

Definition at line 45 of file divhf.py.


The documentation for this class was generated from the following file: