Graphs, Vectors and Machine Learning - Computerphile

Поделиться
HTML-код
  • Опубликовано: 6 авг 2023
  • There's a lot of talk of image and text AI with large language models and image generators generating media (in both senses of the word) - but what about graphs? Dr David Kohan Marzagao specialises in Machine Learning for Graph-Structured Data and takes us through some simple examples.
    mor about David: kohan.uk/
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Комментарии • 75

  • @bottomhat2534
    @bottomhat2534 Год назад +64

    In case anyone is a bit lost as to what's going on with the dot product. Basically, it's a way of comparing two vectors for similarity. So if you've got two identical vectors of length 1 - so both pointing the same way - the dot is 1. Meaning identical.
    Turn one round 180 degrees and the dot product gives -1. If it's perpendicular you get zero. It's a lot like the cosine if you remember your trig.
    Bit more to it if they're not unit vectors with a length of one. It basically gives you the ratio if one were projected onto the other. Imagine a clock face with the long hand at 12. The dot product gives you the amount the short had goes up the long hand as a ratio. So if you shine a light from the side and the shadow of one hand goes half way up the other; then the dot product is 0.5.
    Hope that helps.

    • @rmsgrey
      @rmsgrey Год назад +6

      It's so much like the cosine that the value of the dot product is the cosine of the angle between the two vectors multiplied by their lengths. The fact you can take two unit vectors and work out the angle between them just by multiplying matching components, summing those values, and taking the inverse cosine of the result is a bit weird, but it falls out of the cosine rule.

  • @viktortodosijevic3270
    @viktortodosijevic3270 Год назад +80

    I like this. I'd watch more of this guy explaining graph kernels and beyond!

    • @AG-ur1lj
      @AG-ur1lj 11 месяцев назад

      Me too! But I wish he would do them nude!!

  • @kabuda1949
    @kabuda1949 Год назад +35

    Nice presentation. More content on graphs optimizations

    • @lucas29476
      @lucas29476 Год назад +2

      can you say "please", please? 🙂️

  • @danielwtf97
    @danielwtf97 11 месяцев назад +3

    Really interesting. For all interested in those directions I recommend researching in the direction of graph neural networks and specifically for molecules topological neural networks!

  • @dylancope
    @dylancope 11 месяцев назад +1

    Nice to see David on here!

  • @wouldntyaliktono
    @wouldntyaliktono 11 месяцев назад +1

    You can use graph convolutional networks to classify certain kinds of abuse by the users of your product. It's really flexible when you have sparse bits of information about the relationships between people and products. Graphs are absolutely everywhere.

  • @frederikvanstolk5815
    @frederikvanstolk5815 Год назад

    Sean's really into it this time

  • @novelspace
    @novelspace Год назад +7

    The kernel trick is simply a matrix multiplication. You have a embeddding set A of shape (m,n) and you get your kernel(gram matrix) by computing A@AT (A matmul A Transpose) which will be of shape (m,m) which tells you how similar each vector is to every other vector in the batch. if you flip it AT@A you can use that matrix of shape (n,n) and this is used to compute the covariance matrix and this tells you how how two features vary with respect to each other.
    All this leads into the SVD where the U matrix captures the eigen vectors of the AAT matrix(observations) and the V matrix captures the eigenvectors of the ATA matrix(features)

  • @Amonimus
    @Amonimus 11 месяцев назад +5

    I'd think the similarity between two objects is the % of overlapping arrangements. Identical objects would have 1 similarity, while objects that share a large pattern of elements would have about 0.5 similarity. The problem is that going through all those arrangements would get astronomically many right away.

  • @odorlessflavorless
    @odorlessflavorless Год назад

    So, it seems Dr David is my favorite now :)

  • @ronit8067
    @ronit8067 11 месяцев назад

    shouldent the similarity be the difference between blue and red for each vector? ie the vectors with similar differences are the same?

  • @owenhoffend1277
    @owenhoffend1277 11 месяцев назад +1

    What happens when you use this technique with a distance of 3 and you start having to consider loops?

  • @Ic3q4
    @Ic3q4 3 месяца назад

    i love this channel ngl

  • @JamesGaehring
    @JamesGaehring 11 месяцев назад

    The "plots", distinguished from graphs, which Sean raises at 2:30, are those plots as in a Cartesian coordinate system, like a grid with x and y axes? I assume these algorithms don't apply to plots b/c coordinates are positional, ie, the distance, angle, orientation or other scalar properties of any given coordinate is fixed to the plane itself, and not just relative to other nodes in a graph. Is that more or less why?

  • @user-bd1mf6wp9d
    @user-bd1mf6wp9d 11 месяцев назад +2

    I think we need more videos on Graph theory.

  • @kabrol13
    @kabrol13 11 месяцев назад +1

    Is it not feasible to use an encoder-decoder model to build a low dimension embedding of an adjacency matrix, and then perform cosine similarity?

    • @user-ee1lf9ct1c
      @user-ee1lf9ct1c 11 месяцев назад

      google "Kipf 2016 Variation Graph Autoencoders". the short answer is that graph convolutions have to be permutation invariant which means using a typical CNN or dense layers on the adjacency matrix doesn't work

    • @chingfool-no-matter
      @chingfool-no-matter 11 месяцев назад

      wouldn't the indexing of vertices affect the result?

  • @AuditorsUnited
    @AuditorsUnited Год назад +7

    so text language models use a mapping coordinate system to find what words are most likely near it.. it would work with the graph triangle demos easily

  • @XSDarkMoonZX
    @XSDarkMoonZX 11 месяцев назад

    @15:46, is this correct? A value of 2 for the third entry for WL1(G2) seems to contradict everything.

    • @beeble2003
      @beeble2003 11 месяцев назад

      Yes, it's correct. The two red vertices in the triangle at the top of G2 each have one red neighbour and one blue. (Well, that specific entry is correct -- I didn't check all of them.)

    • @XSDarkMoonZX
      @XSDarkMoonZX 11 месяцев назад

      ​@@beeble2003​​ got it. I was looking for neighboring shapes as opposed to individual neighboring vertices. You're right.

  • @kooskroos
    @kooskroos 7 месяцев назад

    So what did AlphaFold do differently?

  • @mellertid
    @mellertid 11 месяцев назад

    A general computerphile comment: work is slowly being done to build Babbage's analytical engine. Maybe you can feature the project and give it some momentum!

  • @writerightmathnation9481
    @writerightmathnation9481 11 месяцев назад

    @08:35, “We’re not going to go into the details of the kernel method…”.
    Do you have a recommendation for someone who wants to go into the details? A reference maybe?

    • @alanraftel5033
      @alanraftel5033 10 месяцев назад

      Search this course "Machine learning with kernel methods, Spring 2021" thanks to the pandemic they put it online.

  • @olivier2553
    @olivier2553 11 месяцев назад +1

    The problem seems to be not with SVM but how to create a vector that meaningfully represent the graphs.
    In the first example, only counting colour vertex is limiting a graph to blue marbles and red marbles in a bag. That is a very poor representation as it looses all the edges and connections.

  • @Ensorcle
    @Ensorcle Год назад +1

    Awesome. More graphs!

  • @bmitch3020
    @bmitch3020 11 месяцев назад +3

    Instead of three red and three blue nodes, what if we had three blue and one brown? 😁

  • @DeepFindr
    @DeepFindr 11 месяцев назад +1

    Graphs ❤

  • @kawsarahmad
    @kawsarahmad Год назад +3

    👍🏼

  • @MilesBellas
    @MilesBellas 18 дней назад

    Why write on paper instead of using ppt style slides ?

  • @skyscraperfan
    @skyscraperfan Год назад +3

    How can the inner vector show similarity, if you do not normalize the vectors? If you multiply a vector by a factor k, the inner product will also be multiplied with k.

    • @raspberry_picker395
      @raspberry_picker395 Год назад +2

      he literally said that

    • @beeble2003
      @beeble2003 11 месяцев назад

      @@raspberry_picker395 But then he literally continued to use it as a measure of similarity, which is just nonsense.

  • @jorgeguberte
    @jorgeguberte 11 месяцев назад

    obrigado, Dr. Davi!

  • @Veptis
    @Veptis 25 дней назад

    the one thing I really learned, is that dense embedding get learned. These all seem to be calculated...
    We need a word2vec kinda fake task to get something dense and semantically similar?

  • @hansdieter4537
    @hansdieter4537 11 месяцев назад +1

    I understood everything

  • @krox477
    @krox477 Год назад

    Linked List is also graph

  • @beeble2003
    @beeble2003 11 месяцев назад +1

    13:52 It's Leman, not Lehman. Andrei Leman was Russian, not German. But probably half the papers in the literature make this mistake! His co-author, Boris Weisfeiler, at some point emigrated to the US and disappeared in Chile in mysterious circumstances during the Pinochet dictatorship.

  • @MrRyanroberson1
    @MrRyanroberson1 9 месяцев назад +1

    here's an idea: in the edge vectors, each node should be added to all simpler shapes as well. so a blue connected to 2 blues would be added to both the b2b and the b1b options; all blue nodes would be added to a b0 option as well. This measure of similarity would be more robust in the face of nodes with a new neighbor

  • @emjizone
    @emjizone 11 месяцев назад

    @Computerphile : David Kohan Marzagão
    6:13 Are you telling us that we cannot establish a hash function that give a unique number for each possible graph ?
    This is weird, 'cause I think I already did that in my life.
    And yes it worked even without specifying any starting point in the graph. It was symmetry-asymmetry-based.
    Applying the most tedious and unsmart of naive approaches, we could simply compare the respective sets of all possible paths in each graph. It's very slow, but it proves my point, doesn't it?
    Nor is it very difficult to define a distance between graphs by minimizing the number of reversible transformations required to transform one graph into another.
    So, How to prove it cannot be done in the general case ? 🤨

    • @beeble2003
      @beeble2003 11 месяцев назад +1

      You can produce a hash function that will give a unique number for each possible graph -- this is called "graph canonization". However, there is no known way to do this efficiently (i.e., in polynomial time), because it's computationally equivalent to the graph isomorphism problem. If you think you have an efficient algorithm for graph canonization, there are basically three possibilities (listed in decreasing order of probability):
      1. it's not actually a canonization algorithm -- either it assigns the same number to two graphs that are not isomorphic, or it assigns different numbers to two different presentations of the same graph;
      2. it's not actually as efficient as you think;
      3. you've made a major breakthrough in computer science.
      To take your specific example of comparing the set of all possible paths, that fails both point 1 and point 2 (as you say -- it's very slow). For point 1, consider a cycle of three vertices and a cycle of four vertices: each contains paths of all possible lengths. For point 2, a graph can have factorially many paths, even if you restrict to non-repeating ones.

  • @N0Xa880iUL
    @N0Xa880iUL Год назад +1

    He just like me frfr

  • @hbertoduarte
    @hbertoduarte Год назад +2

    Isn't that molecule Methanol?

    • @S_t_r_e_s_s
      @S_t_r_e_s_s Год назад

      Close but missing the other three hydrogen.

    • @kuhluhOG
      @kuhluhOG Год назад +1

      @@S_t_r_e_s_s you can just leave the "H" if it's hydrogen on an edge (but only if it's hydrogen)
      although you would normally do it for all cases

    • @andrewferguson6901
      @andrewferguson6901 11 месяцев назад

      ​@kuhluhOG he drew a line, if you know some chem that looks like hydrogen

    • @Tyler_0_
      @Tyler_0_ 9 месяцев назад

      tert-butanol since lines ending without a symbol typically represent carbon. It would be methanol with hydrogens at the end of those lines though.

  • @utkufisek
    @utkufisek 10 месяцев назад

    New color labeling feels like graph derivation.

  • @less6301
    @less6301 11 месяцев назад

    it doesnt really work thow imeen frm anklemblussFGH 2#4

  • @BenjaminEhrlich272
    @BenjaminEhrlich272 11 месяцев назад

    After office hours teaching me further on Kernel Hilbert space my ML professor said with disappointment (paraphrased) "But, all of this doesn't matter practically because deep learning, while it's inner workings are not understood rigorously, performance are so much better..." Do you mathematicians have any unput? It makes the work I study and teach in Discrete math seem fascinating but in the end, not practically useful...

  • @MedEighty
    @MedEighty 11 месяцев назад +1

    13:10 Oh those pens are going to dry out. Put their lids on, man!

  • @SergeMatveenko
    @SergeMatveenko 11 месяцев назад

    Unclosed bracket 🤯

    • @beeble2003
      @beeble2003 11 месяцев назад +1

      Here you go: >

  • @frank93907
    @frank93907 11 месяцев назад

    Network topology

  • @maartengees7158
    @maartengees7158 11 месяцев назад

    the molecule is methanol...

  • @skf957
    @skf957 Год назад +2

    I wish my brain was larger. Or denser. Or something.

    • @devon9374
      @devon9374 11 месяцев назад

      Don't we all 😂

  • @HereIM27
    @HereIM27 11 месяцев назад

    >

  • @tojohahn8529
    @tojohahn8529 Год назад

    Hydrogen Peroxide and Hydrogen Peroxide Water

  • @zxuiji
    @zxuiji Год назад

    I say it's rather simple, treat shapes as a tree of shapes, even the simplex shapes, you start by identifying the simplex shapes then repeat the same comparisons with the simplex shapes as the new nodes, then again with the complex shapes as the new nodes, you keep going until all your comparisons start returning less than 50% probability of being the right deal, then you just use the most complex shape that gave a >= probability of being correct, (>= to last recorded shape)
    **Edit:** To be clear you're building the tree from the leaves, hence the most complex shape taking priority over the simpler shapes, then the match rate over last match rate
    **Edit 2:** Here's an simplistic example using a photo of a cat's head as the assumed image to analyse for a shape
    Every strand of fur is a LINE of colours (treated as spheres)
    Every edge of is treated as a LINE of strands of fur
    Each ear is treated as a TRIANGLE of edge LINEs, the head center treated as a SPHERE/CIRCLE of edge LINEs
    The cat head is treated as a combination of a SPHERE/CIRCLE with 2 triangles either side, those having been identified by the previous loop of analysis
    So in other words it's an exponential problem that can be done fast ONLY with lots of chips/brain cells to do dedicated analysis of a node set vs all other node sets (the initial spheres of colour being the only node sets with just 1 node)

  • @JavierSalcedoC
    @JavierSalcedoC 11 месяцев назад

    This must be related to Moleds. Everything is Moleds after all

  • @azrobbins01
    @azrobbins01 Год назад

    I read all the comments and apparently I was the only one who was distracted by the absence of color in this man's lips. Maybe they go white when he is nervous, or maybe it was a cold room.

    • @drdca8263
      @drdca8263 11 месяцев назад

      :?
      Is it really that unusual? It doesn’t seem like it to me.
      Ok, looking, yes, mine to appear to be a fair bit more red then his (though, largely hidden by my mustache),
      But like.. still?

    • @kellysmith7357
      @kellysmith7357 11 месяцев назад

      maybe ur the only one staring at his lips

    • @azrobbins01
      @azrobbins01 11 месяцев назад

      @@kellysmith7357 Must be, since I am the only one why commented on it.

  • @lancerfour
    @lancerfour 11 месяцев назад

    i think you should apologize to dogs and cats

  • @sameersee1
    @sameersee1 8 месяцев назад

    stop interrupting the guy over and over. let him explain!

  • @DC-go5mc
    @DC-go5mc 11 месяцев назад

    Couldn't continue watching. The off-camera man kept interrupting the speaker.