Class Tsne

java.lang.Object
ai.beestream.jitnn.ml.Tsne

public final class Tsne extends Object
Exact t-SNE (van der Maaten and Hinton, 2008) on the device, after scikit-learn's TSNE with method="exact": Gaussian affinities calibrated per point to the perplexity by bisection on the precision, symmetrised; a Student-t kernel in the embedding; gradient descent with momentum (0.5, then 0.8), early exaggeration (12 for 250 iterations), per-parameter gains (+0.2 / x0.8, at least 0.01) and the learning rate max(n / 12 / 4, 50). The embedding starts from PCA, scaled so the first coordinate has standard deviation 1e-4. O(n^2) memory and time per iteration.
  • Constructor Summary

    Constructors
    Constructor
    Description
    t-SNE with scikit-learn's defaults: 2 dimensions, perplexity 30, 1000 iterations.
    Tsne(int components, float perplexity, int iterations)
    t-SNE into components dimensions with the given perplexity and number of iterations.
  • Method Summary

    Modifier and Type
    Method
    Description
    The embedding [n, components] of samples x [n, features], starting from their PCA projection.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Tsne

      public Tsne(int components, float perplexity, int iterations)
      t-SNE into components dimensions with the given perplexity and number of iterations.
    • Tsne

      public Tsne()
      t-SNE with scikit-learn's defaults: 2 dimensions, perplexity 30, 1000 iterations.
  • Method Details

    • fitTransform

      public Tensor fitTransform(Tensor x)
      The embedding [n, components] of samples x [n, features], starting from their PCA projection.