This document explains how AlgoPy is structured.
The submodule tracer contains two classes
CGraph stands for computational graph and is a directed acyclic graph. A node in the CGraph is an instance of Function.
It is called “tracer” since the sequence of operations to evaluate some function:
def eval_f(x):
...
return y
is recorded and stored in a CGraph instance.
Using CGraph.gradient, CGraph.jacobian, etc. one can evaluate derivatives in the forward and reverse mode of AD.
The function CGraph.pullback cycles in reverse direction through the sequence of operations and calls at each Node the method Function.pullback, which in turn calls one of the classmethods UTPM.pb_*.
The submodule UTPM contains an implementation of the algebraic class of matrix Taylor polynomials. It is an “extension” of numpy.ndarray.
Normally, for each file file.py there exists a tests/test_file.py.
In this folder there are tests that check the functionality as seen by a user.