Giter VIP home page Giter VIP logo

Comments (6)

lmcinnes avatar lmcinnes commented on April 28, 2024

It is a little hard to do that and still maintain efficiency; potentially it could be added as an extra code-path on the side that is slower but more flexible. That would be a more significant project however.

from umap.

znah avatar znah commented on April 28, 2024

Thank you for the prompt reply!
I'm actually looking forward seeing your write-up about UMAP algorithm, hoping to reimplement it in a flexible way. For example, the most naive implementation of tsne loss with TensorFlow boils down to something like this:

def tsne_kl_loss(points, P):
    n = tf.shape(points)[0]
    Q = 1.0 / (1.0 + pdist2(points))
    sQ = tf.reduce_sum(Q) - tf.cast(n, tf.float32)
    return tf.reduce_sum(P*tf.log(P/Q)) + tf.log(sQ)

Then one can combine this loss with others and use one of standard optimizers.
Do you think if this kind of approach can be adopted to UMAP?

from umap.

lmcinnes avatar lmcinnes commented on April 28, 2024

At that level, yes almost certainly; if you are willing to do N^2 work then you can certainly have custom loss -- I was generally seeking to avoid that. On that front you might be interested by smallvis which implements t-SNE, LargeVis and UMAP in a common framework which I suspect would easily be adaptable to custom loss functions. The cathc is that it only supports small datasets for exactly the reason cited above. As a way to experiment, however, it is quite powerful.

from umap.

znah avatar znah commented on April 28, 2024

Thank you for pointing me to smallvis! I think that's exactly what I needed.
N^2 can actually go surprisingly far with efficient GPU implementation. For example, here is a random youtube video showing n^2 nbody with 60k particles at 30fps.

Still, I like to think of algorithmic optimizations, like employing BH or something else as yet another, partially orthogonal component.

from umap.

vanhoan310 avatar vanhoan310 commented on April 28, 2024

How to obtain the matrix P from UMAP? Is it self.graph_ from fuzzy_simplicial_set function?

Thanks!

from umap.

lmcinnes avatar lmcinnes commented on April 28, 2024

That is the equivalent of it, yes.

from umap.

Related Issues (20)

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.