Skip to content

Conversation

@dlidstrom
Copy link
Owner

  • fix(training): correct loop bounds and indexing in weights update
  • style(neural): reformat and align code for consistency

This fixes #29.

The change fixes incorrect loop bounds and indexing when updating weights from the hidden layer to output layer. The outer loop now iterates over network.inputCount instead of network.hiddenCount, and the inner loop iterates over network.hiddenCount instead of network.outputCount. This ensures that each input node properly updates its respective connections to the hidden nodes, correcting potential miscalculations in the weight adjustments during training.
Aligns code to ensure consistent formatting across the `neural.cpp` file. This involves adjusting indentation, spacing in function parameter declarations, and using designated initializers for structures where applicable. These changes improve readability and maintainability without affecting functionality.
@dlidstrom dlidstrom merged commit 99f6e9b into main Nov 10, 2025
10 checks passed
@dlidstrom dlidstrom deleted the cpp_bug branch November 10, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cpp training bug

2 participants