From de73f3cce9a5f7ade5f4497269c7e69d923580d2 Mon Sep 17 00:00:00 2001 From: Isaac Clayton Date: Fri, 7 Jan 2022 21:00:59 +0100 Subject: wrote out procedure for computing a step --- src/main.rs | 1 + src/quad.rs | 1 - src/step.rs | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/step.rs diff --git a/src/main.rs b/src/main.rs index 1757013..10e7850 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ mod quad; mod ctx; +mod step; fn main() { println!("Hello, world!"); diff --git a/src/quad.rs b/src/quad.rs index bab0491..25fda47 100644 --- a/src/quad.rs +++ b/src/quad.rs @@ -50,5 +50,4 @@ impl Node { pub fn pad_empty(self, ctx: &mut Ctx) -> Self { todo!() } - } diff --git a/src/step.rs b/src/step.rs new file mode 100644 index 0000000..1256688 --- /dev/null +++ b/src/step.rs @@ -0,0 +1,29 @@ +use crate::ctx::Ctx; +use crate::quad::Node; + +pub fn step(ctx: &mut Ctx, node: Node) -> Node { + // pad the graph if needed. + + // if we're at the base, run the cellular automation rule: + // collect training pair base -> rule. + // return the updated cached node. + + // forward predict all children nodes of the root + // collect children nodes into vector X, X' + // forward predict compressed representation of root Y, Y' + // our target is to train Y' to match X'. + + // calculate the difference between X and Y. + // if the difference is below an acceptable threshold: + // collect training pair Y -> X' (with error Y'). + // return the updated cached node with compr = X' + + // if the difference is above an acceptable threshold: + // recurse `step` on each child to produce four vectors + // (the recursion will stop when the true base is reached or threshold is small enough.) + // collect all children predictions into Z' + // collect training pair Y -> Z' (with error Y'). + // return the updated cached node with compr = Z'. + + todo!("Implement a step!") +} -- cgit v1.2.3-70-g09d2