OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-matrix commits / 8ed108d

Provde an executive summary
8ed108d8bd851bfb37f5addea4f5f8a6dadd6726
by Linas Vepštas <linasvepstas@gmail.com> · 2025-01-21T16:19:11.000Z

Changed files (1) +47 -4

README.md +47 -4
……@@ -1,8 +1,51 @@
11
2Correlation/Covariance Matrix Analysis Tools
3============================================
4[See also: key ideas presentation](docs/AtomSpace.pdf).
5
2Graph Sparse Vector Library
3===========================
4[![CircleCI](https://circleci.com/gh/opencog/matrix.svg?style=svg)](https://circleci.com/gh/opencog/matrix)
5
6See: [Presentation slides of key ideas](opencog/matrix/docs/AtomSpace.pdf).
7
8Large complex graphs typically have many vertexes and edges that encode
9similar "objects", much like all of the rows of a database table are
10"similar". That collection of vertexes/edges can be thought of as
11forming a vector. Such a vector is sparse, in that it is built out of
12only some small fragment of the total graph. If the graph is big enough,
13there might be thousands (or millions) of such vectors, and then one is
14typically interested in doing conventional vector, matrix, tensor
15analysis on that collection of (sparse) vectors. This repo contains
16a library/toolset for performing this kind of analysis: correlation,
17covariance, mutual information, similarity measures of various kinds,
18and more.
19
20### Sparse and Dense Vectors
21These are *not DL/NN vectors*. The vectors and weight matrices that
22arise in deep learning neural nets (transformers, generative AI, etc.)
23are dense, not sparse. If a typical DL/NN vector is one-million-dimensional,
24then a dense vector will have all million basis coefficients be non-zero.
25A sparse vector will have all except a small number (say, a thousand) be
26zero.
27
28This has storage implications: if 99% of a vector is zero, you don't need
29to store those zeros! If 99% of a vector is zero, you don't need to pass
30it into your GPU's for processing, or send those zeros to some remote
31machine in a compute cluster.
32
33The [AtomSpace](https://github.com/opencog/atomspace) is a (hyper-)graph
34database, and, as such, is highly optimized for sparse vector storage.
35Thus, all the code here is in reference to the AtomSpce (and not some
36other graph database.)
37
38The code here is a library build from the ground-up. It does ***not***
39make use of pre-existing tools or libraries that can be found in R or
40SciPy. It would be nice if it was possible to use those systems: they
41are very popular, with many many users. Unfortunately, both of them
42choke on large vectors, and have no support for sparse vectors. If you
43ask SciPy to create a million-dimensional vector, you'll run out of RAM
44and then crash. The code in this directory routinely handles vectors of
45this size.
46
47Motivation
48----------
649In symbolic AI, there is a generic need to perform "reasoning" or
750"inference". There are more than a few ways this can be done. A
851traditional approach is "chaining", where one explores connected