From a6ec4288a2232988b130b2f00bb2565f81706966 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Mon, 29 Jun 2026 12:15:51 -0500 Subject: Recursive reasoning dynamics: analysis pipeline, paper drafts, toy models Failure=more-chaotic (task-general under validity labeling) reduces to convergence/completeness detection; mechanism (transient chaos vs multistability vs input-induced) under investigation. Co-Authored-By: Claude Fable 5 --- external/GradientFlossing/README.md | 79 ++++++++++++++++++++++++++++++++++ external/GradientFlossing/packages.txt | 6 +++ 2 files changed, 85 insertions(+) create mode 100644 external/GradientFlossing/README.md create mode 100644 external/GradientFlossing/packages.txt (limited to 'external/GradientFlossing') diff --git a/external/GradientFlossing/README.md b/external/GradientFlossing/README.md new file mode 100644 index 0000000..962c955 --- /dev/null +++ b/external/GradientFlossing/README.md @@ -0,0 +1,79 @@ +# Gradient Flossing: Improving Gradient Descent through Dynamic Control of Jacobians + +This repository contains the implementation code for manuscript:
+__Gradient Flossing: Improving Gradient Descent through Dynamic Control of Jacobians__
+## Overview +In this work we show that RNN training can be improved by pushing Lyapunov exponents of the forward pass to zero during or before training. + +## Installation + +#### Prerequisites +- Download [Julia](https://julialang.org/downloads/) + +#### Dependencies +- Julia (1.6) +- Flux, BackwardsLinalg + +## Getting started +To install the required packages, run the following in the julia REPL after installing Julia: + +``` +using Pkg + +for pkg in ["Flux", "BackwardsLinalg"] + Pkg.add(pkg) +end +``` + +For example, to train an RNN on tracking delayed XOR task, run: +``` +include("GradientFlossing_ExampleCode.jl") +# setting parameters: +N, E, Ef, Ei, Ep, Ni, B, S, T, Tp, Ti, sIC, sIn, sNet, sONS, lr, b1, b2, IC, g, gbar, I1, delay, wsS, wsM, wrS, wrM, bS, bM, nLE, task, intype, Lwnt= +80, 3001, 100, 500, 500, 2, 16, 1, 300, 55, 300, 1,1,1,1, 0.001f0, 0.9, 0.999, 1, 1.0, 0.0, 1.0,10, 1.0f0, 0.0f0, 1.0f0, 0.0f0, 0.1f0, 0.0f0,75, -1, 3, 0.0 + +trainRNNflossing(N, E, Ef, Ei, Ep, Ni, B, S, T, Tp, Ti, sIC, sIn, sNet, sONS, lr, b1, b2, IC, g, gbar, I1, delay, wsS, wsM, wrS, wrM, bS, bM, nLE, task, intype, Lwnt) +``` + +## Repository Overview +_GradientFlossing_ExampleCode.jl_:\ +Example scripts for training networks with gradient flossing before training, with gradient flossing before and during training and without gradient flossing. + + +_GradientFlossing_XOR.jl_:\ +Generates input and target output for copy task and delayed XOR task. + + + + + + + +### Implementation details +A full specification of packages used and their versions can be found in _packages.txt_ .\ +For learning rates the default ADAM parameters were used to avoid any impression of fine-tuning.\ +All simulations were run on a single CPU and took on the order of minutes to a few of hours. + + + + + + + diff --git a/external/GradientFlossing/packages.txt b/external/GradientFlossing/packages.txt new file mode 100644 index 0000000..e90facc --- /dev/null +++ b/external/GradientFlossing/packages.txt @@ -0,0 +1,6 @@ +julia => v"1.6.7" + +[442b4e1a] BackwardsLinalg v0.1.1 +[587475ba] Flux v0.11.3 +[e6cf234a] RandomNumbers v1.5.3 +[e88e6eb3] Zygote v0.5.1 -- cgit v1.2.3