-
Notifications
You must be signed in to change notification settings - Fork 38
Building Learning Systems
The code explained below is no longer used (at least not much).
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].
We construct a differentiable function in pieces. The forward function itself is a one-liner, but the gradient is cleaner in steps.
-
Note: It is crucial that one of the moves is the identity on V.
-
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].
-
For combinations (V, V) => Option[V], we use combinationFn instead.
-
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.
-
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.
-
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].
-
Now use extendM to get a function f: (FD[M], FD[V]) => (FD[M], FD[V])
-
Use Diffblefunction.iterate to create an iteration for fixed n.
-
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].
-
We can compose g with the previous function iterated n times to get another function h: (FD[M], FD[V]) => FD[P].
-
Conjugating the feedback by this gives a flow function from (FD[M], FD[P]) to itself. We evolve along this.
-
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).