lejon / T-SNE-Java

Pure Java implementation of Van Der Maaten and Hinton's t-sne clustering algorithm
197 stars 60 forks source link

Improve gradient calculation #3

Closed lejon closed 9 years ago

lejon commented 9 years ago

There is a faster, simpler way to evaluate the gradient. It involves the following two lines of code (P, Q, and num are defined in the same way):

    L = (P - Q) .* num;
    y_grads = 4 * (diag(sum(L, 1)) - L) * ydata;
lejon commented 9 years ago

Implemented in both SimpleTSne and FastTSne