Skip to content

Conversation

tf318
Copy link

@tf318 tf318 commented Apr 8, 2023

The original recursive back propagation algorithm performs breadth-first visiting of Values in the graph, simply to add them to a linear sequence. The sequence is then reversed and iterated over to invoke the _backward() function in each Value.

It is possible to invoke the _backward() function in a single pass during the breadth-first visiting of Values, without creating an interim linear sequence. This PR simplifies the algorithm accordingly.

@conscell
Copy link

@tf318 This implementation fails tests:
FAILED test_engine.py::test_sanity_check - assert 128.0 == 46.0
FAILED test_engine.py::test_more_ops - assert 15.166180758017475 < 1e-06

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.

2 participants