#
Block
A Block
is a recursive graph structure composed of Unit
s, Layer
s, and Block
s. A Block
is implicitly created using the >>
operator.
#
Export as Module
Sometimes you may want to export a Block
as a module. We recommend wrapping it in its own Block
for clarity.
# model/ensemble.py
Ensemble = Block() >> Layer(...)
# experiment.py
from verdict import Pipeline
from .model.ensemble import Ensemble
pipeline = Pipeline() >> Ensemble()
#
Materialization
As mentioned in the Programming Model section, a Block
is a recursive graph structure. The materialize
method recursively flattens all sub-graphs into a flat list of Unit
s.
#
Prefix
Through the materialization process, we interatively construct a unique prefix
for each Unit
using the following rules.