betty.engine¶
Unlike traditional automatic differentiation techniques that calculate analytic Jacobian for each operation, multilevel optimization requires approximating best-response Jacobian for each level optimization problem. Below is the list of approximation techniques that are supported by Betty.
Engine¶
- class betty.engine.Engine(problems, config=None, dependencies=None, env=None)[source]¶
Engine
handles a dataflow graph based on the user-provided hierarchical problem dependencies. It also provides a primitive for executing multilevel optimization.- check_leaf(problem)[source]¶
Check whether the given
problem
is a leaf problem or not.- Parameters:
problem (Problem) – Problem in multilevel optimization
- Returns:
True or False
- Return type:
bool
- configure_systems()[source]¶
Configure basic systems set-up like distributed training and device placement.
- find_paths(src, dst)[source]¶
Find all paths from
src
todst
with a modified depth-first search algorithm.
- is_implemented(fn_name)[source]¶
Check whether
fn_name
method is implemented in the class.- Parameters:
fn_name (str) – class method name
- Return type:
bool
- parse_dependency()[source]¶
Parse user-provided
u2l
andl2u
dependencies to figure out 1) topological order for multilevel optimization execution, and 2) backpropagation path(s) for each problem. A modified depth-first search algorithm is used.