Skip to content

Building Learning Systems

Siddhartha Gadgil edited this page Dec 10, 2019 · 2 revisions

Obsolete documentation

The code explained below is no longer used (at least not much).

Building learning systems

Context:

We have a collection V of vertices and a set of (optional) moves and possibly some combinations on V. Thus, we have a collection, indexed by m : M, of functions

  • V => Option[V]
  • (V, V) => Option[V]

We also have (or can construct) a differentiable function FD[V] => FD[P], and have a feedback on FD[P].

Combinators: Overview

We construct a differentiable function in pieces. The forward function itself is a one-liner, but the gradient is cleaner in steps.

Constructing the main function.

  1. Note: It is crucial that one of the moves is the identity on V.

  2. For a fixed move, associated to m : M, given by a function V => Option[V], applying moveFn gives a function f(m): FD[V] => FD[V].

  3. For combinations (V, V) => Option[V], we use combinationFn instead.

  4. For fixed m: M, we apply weightedDyn to get a function (FD[M], FD[V]) => FD[V] taking (p, m) to p(m)f(m), with f(m) the function associated to the move m and p(m) the weight at m.

  5. Given a collection of moves, say of type List[M], we can map to a collection of function (FD[M], FD[V]) => FD[V]) as above.

  6. We add together the above collection of Differentiable functions. To do this, we an implicit vector space structure and apply vbisum. We get a single sum function (FD[M], FD[V]) => FD[V].

  7. Now use extendM to get a function f: (FD[M], FD[V]) => (FD[M], FD[V])

  8. Use Diffblefunction.iterate to create an iteration for fixed n.

Using the feedback

  1. Use project and a map induced (using moveFn) by a function from V to P to get a function g: (FD[M], FD[V]) => FD[P].

  2. We can compose g with the previous function iterated n times to get another function h: (FD[M], FD[V]) => FD[P].

  3. Conjugating the feedback by this gives a flow function from (FD[M], FD[P]) to itself. We evolve along this.

  4. Equivalently, we can conjugate the feedback on FD[P] by g to get a feedback on (FD[M], FD[P]). We then conjugate this by f^n (this is nicer as it separates the iteration and pulling back the feedback).