O
- Object type@Reference(authors="G. Hinton, S. Roweis", title="Stochastic Neighbor Embedding", booktitle="Advances in Neural Information Processing Systems 15", url="http://papers.nips.cc/paper/2276-stochastic-neighbor-embedding", bibkey="DBLP:conf/nips/HintonR02") public class SNE<O> extends AbstractProjectionAlgorithm<Relation<DoubleVector>>
Reference:
G. Hinton, S. Roweis
Stochastic Neighbor Embedding
Advances in Neural Information Processing Systems 15
Modifier and Type | Class and Description |
---|---|
static class |
SNE.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected AffinityMatrixBuilder<? super O> |
affinity
Affinity matrix builder.
|
protected int |
dim
Desired projection dimensionality
|
protected double |
finalMomentum
Final momentum.
|
protected static double |
INITIAL_SOLUTION_SCALE
Scale of the initial solution.
|
protected double |
initialMomentum
Final momentum.
|
protected int |
iterations
Number of iterations.
|
protected double |
learningRate
Initial learning rate.
|
private static Logging |
LOG
Class logger.
|
protected static double |
MIN_GAIN
Minimum gain in learning rate.
|
protected static double |
MIN_QIJ
Minimum value for qij entries (even when duplicate)
|
protected int |
momentumSwitch
Iteration when to switch momentum.
|
protected long |
projectedDistances
Number of distance computations performed in projected space.
|
protected RandomFactory |
random
Random generator
|
KEEP_ID
ALGORITHM_ID
Constructor and Description |
---|
SNE(AffinityMatrixBuilder<? super O> affinity,
int dim,
double finalMomentum,
double learningRate,
int iterations,
RandomFactory random,
boolean keep)
Constructor.
|
SNE(AffinityMatrixBuilder<? super O> affinity,
int dim,
RandomFactory random)
Constructor with default values.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeGradient(AffinityMatrix pij,
double[][] qij,
double qij_isum,
double[][] sol,
double[] meta)
Compute the gradients.
|
protected double |
computeQij(double[][] qij,
double[][] solution)
Compute the qij of the solution, and the sum.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
protected void |
optimizeSNE(AffinityMatrix pij,
double[][] sol)
Perform the actual tSNE optimization.
|
protected static double[][] |
randomInitialSolution(int size,
int dim,
java.util.Random random)
Generate a random initial solution.
|
Relation<DoubleVector> |
run(Relation<O> relation) |
protected double |
sqDist(double[] v1,
double[] v2)
Squared distance, in projection space.
|
protected void |
updateSolution(double[][] sol,
double[] meta,
int it)
Update the current solution on iteration.
|
removePreviousRelation
run
private static final Logging LOG
protected static final double MIN_QIJ
protected static final double INITIAL_SOLUTION_SCALE
protected static final double MIN_GAIN
protected AffinityMatrixBuilder<? super O> affinity
protected long projectedDistances
protected int dim
protected double learningRate
protected double initialMomentum
protected double finalMomentum
protected int momentumSwitch
protected int iterations
protected RandomFactory random
public SNE(AffinityMatrixBuilder<? super O> affinity, int dim, RandomFactory random)
affinity
- Affinity matrix builderdim
- Output dimensionalityrandom
- Random generatorpublic SNE(AffinityMatrixBuilder<? super O> affinity, int dim, double finalMomentum, double learningRate, int iterations, RandomFactory random, boolean keep)
affinity
- Affinity matrix builderdim
- Output dimensionalityfinalMomentum
- Final momentumlearningRate
- Learning rateiterations
- Number of iterationsrandom
- Random generatorkeep
- Keep the original data (or remove it)public Relation<DoubleVector> run(Relation<O> relation)
protected static double[][] randomInitialSolution(int size, int dim, java.util.Random random)
size
- Data set sizedim
- Output dimensionalityrandom
- Random generatorprotected void optimizeSNE(AffinityMatrix pij, double[][] sol)
pij
- Initial affinity matrixsol
- Solution output array (preinitialized)protected double computeQij(double[][] qij, double[][] solution)
qij
- Qij matrix (output)solution
- Solution matrix (input)protected double sqDist(double[] v1, double[] v2)
v1
- First vectorv2
- Second vectorprotected void computeGradient(AffinityMatrix pij, double[][] qij, double qij_isum, double[][] sol, double[] meta)
pij
- Desired affinity matrixqij
- Projected affinity matrixqij_isum
- Normalization factorsol
- Current solution coordinatesmeta
- Point metadataprotected void updateSolution(double[][] sol, double[] meta, int it)
sol
- Solution matrixmeta
- Metadata array (gradient, momentum, learning rate)it
- Iteration number, to choose momentum factor.public TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Relation<DoubleVector>>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Relation<DoubleVector>>
Copyright © 2019 ELKI Development Team. License information.