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