Vector Symbolic Architectures In Clojure - Carin Meier
- https://github.com/gigasquid/vsa-clj
- hyperdimensional computing
- 10k dimensions
- each point represents an idea
Explain MAP,, initialie HDV and an Introduction to Hyperdimensional computing
[AI]: MAP (Maximum a posteriori probability) is a statistical method used in machine learning and signal processing to estimate a probability distribution based on observed data. It allows us to determine the most probable value of unknown variables based on the data we have.
Initialize HDV (Hyperdimensional Vector) refers to the process of initializing the data structure used in hyperdimensional computing. HDV is a high-dimensional vector that represents features of data. The initialization process involves assigning random values to each dimension of the HDV, which are later updated during the learning process.
Hyperdimensional computing (HDC) is a machine learning technique that uses high-dimensional vectors to process and store data. HDC is based on the mathematical principles of geometric algebra and has been used to solve problems in image recognition, natural language processing, and speech processing. The technique works by representing data items as high-dimensional vectors and computing the similarity between them using geometric algebra. HDC has shown promising results in several applications and is still an active area of research.
[ME]: create a hd vecotr in clojure
[AI]: Here is an example of how to create a Hyperdimensional Vector in Clojure:
```clojure (defn hdv-init [dim] (let [hdv (vec (repeat dim 0))] (doseq [i (range dim)] (aset hdv i (if (rand-nth [true false]) 1 -1))) hdv)) ```
This function `hdv-init` takes a single argument `dim`, which specifies the size of the Hyperdimensional Vector. The function initializes a Clojure vector of size `dim` with zeros, and then iterates over each dimension, setting it to either 1 or -1 with equal probability using `rand-nth`. The resulting vector is returned as the Hyperdimensional Vector.
Example usage:
```clojure (def my-hdv (hdv-init 100)) ```
This creates a 100-dimensional Hyperdimensional Vector and stores it in the variable `my-hdv`.
[ME]: show how to create bind and bundle for HD vectors
[AI]: Here's an example of how to create a bind and bundle operation for Hyperdimensional Vectors in Clojure:
```clojure (defn hdv-bind [hdv1 hdv2] (vec (map * hdv1 hdv2)))
(defn hdv-bundle [& hdvs] (reduce hdv-bind hdvs)) ```
The `hdv-bind` function takes two Hyperdimensional Vectors `hdv1` and `hdv2`, and returns a new Hyperdimensional Vector that is the element-wise product of `hdv1` and `hdv2`.
The `hdv-bundle` function takes any number of Hyperdimensional Vectors as arguments and returns a new Hyperdimensional Vector that is the element-wise product of all the input vectors. This is achieved by using the `reduce` function to apply `hdv-bind` to all the input vectors.
Example usage:
```clojure (def hdv1 (hdv-init 50)) (def hdv2 (hdv-init 50)) (def hdv3 (hdv-init 50))
(def bundled-hdv (hdv-bundle hdv1 hdv2 hdv3)) ```
This creates three 50-dimensional Hyperdimensional Vectors and stores them in `hdv1`, `hdv2`, and `hdv3`. The `hdv-bundle` function is then called with these vectors as arguments, and the resulting bundled Hyperdimensional Vector is stored in `bundled-hdv`.
[ME]:
- get core data structures