adative learning and early stoping along with refactor and small touches - #1
Open
tndmadman wants to merge 7 commits into
Open
adative learning and early stoping along with refactor and small touches#1tndmadman wants to merge 7 commits into
tndmadman wants to merge 7 commits into
Conversation
Refactor code: removed non-ASCII spaces, ensured all braces match, and normalized formatting with go fmt Unified logging: consolidated fmt.Printf calls onto single lines using \n Adaptive learning rate: added initLR parameter, decayed LR by 10% every 2,000 epochs Early stopping: added patience and minDelta parameters to halt training when no improvement Enhanced Train signature in both dendritic_neuron.go and dendritic_neuron_circle.go XOR example (dendritic_neuron.go): updated to use adaptive LR & early stopping, formatted predictions output Circle example (dendritic_neuron_circle.go): same enhancements plus generateCircleData() and final accuracy report
feat: implement universal dendritic neuron for all logic gates and blocks - Added universal dendritic neuron model supporting multiple dendritic compartments - Supports training on classic logic gates (AND, OR, NOT, NAND, NOR, XOR, XNOR, BUFFER) - Added training data and support for combinational logic blocks: Half Adder and Full Adder (sum and carry) - Multithreaded training using Go goroutines for better performance - Adaptive learning rate with decay every 2000 epochs - Output includes detailed testing results and overall accuracy percentage - Code refactored for concurrency safety using mutex locks
- Implemented dendritic compartment and neuron models with forward pass and training - Added adaptive learning rate and early stopping in training loop - Included XOR logic gate training example - Added synthetic circle data generation and training for nonlinear classification - Developed multi-output dendritic neuron for multiple logic gates and combinational logic blocks (AND, OR, NOT, NAND, NOR, XOR, XNOR, BUFFER, Half Adder, Full Adder) - Implemented multi-threaded training with synchronization for efficiency - Provided extensive testing and accuracy evaluation for all trained logic gates and blocks - Improved code modularity with separate structs and training workers
Owner
|
Check out the latest implementations. The most recent successes of tying the neurons together are dann_tumor_bio.go, dann_tumor.go and the sine approximation test with a standard neural network as a control case. Unaddressed- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactored Neuron and Compartment Logic
Preserved original neuron and dendritic compartment structure.
Cleaned up variable naming for clarity and consistency.
Added optional sigmoid and tanh explanations as inline comments.
Enhanced Training Routine
Added adaptive learning rate decay.
Introduced early stopping using patience and minDelta.
Error is now tracked and logged every 1000 epochs for long runs.
Extended Task Support
Expanded from just XOR and circle classification to:
Implemented label-based multi-output support (universal neuron model).
Multi-Label Training Architecture
Introduced []float64 expected outputs per training sample.
Built a universal label-to-index map (labelIndexMap) and corresponding output vector for each logic label.
All logic gates and combinational circuits are trained simultaneously.
Multithreaded Training
Training now runs across multiple cores using Go’s sync.WaitGroup and runtime.GOMAXPROCS().
Training batches are divided and updated in parallel using per-thread gradient accumulation and a mutex-protected global weight update step.
Improved Accuracy Evaluation
Added clean, structured printout showing input, expected, predicted, rounded output, and correctness.
Final output includes overall accuracy across all tasks.
New Data Generation Functions
makeMultiLabelData() produces samples for logic gates and adders.
generateCircleData() enables spatial classification for non-linear tests.
Other Enhancements
Added reusable functions like normalizeInput() for data prep.
Replaced hard-coded gates with scalable, indexed label definitions.
Added detailed inline comments and structure for clarity and learning.
📁 File Structure & Usage
💡 Future Work