traced_hp
Module to specify the basic hyperparameter with tracing capabilities.
Classes
A simple registry to keep track of different traced hp classes and their symbols. |
|
A hparam that exhibits additional functionality required to handle tracing. |
- class TracedHp
Bases:
Hparam
A hparam that exhibits additional functionality required to handle tracing.
- classmethod initialize_from(hp)
Initialize a new hparam from an existing vanilla Trace.
- resolve_dependencies(sym, get_hp)
Resolve dependencies of the hparam via symbolic map.
This method iterates through the dependency map described in sym and generates an appropriate hparam based on the currently assigned hparam and the parent symbol.
- Parameters:
- Returns:
A mapping describing the hparam that should be associated with each symbol.
- Return type:
- class TracedHpRegistry
Bases:
object
A simple registry to keep track of different traced hp classes and their symbols.
- classmethod get(sym)
Get Hparam type associated with symbol.
- classmethod initialize_from(sym, hp)
Initialize the sym-appropriate hparam from a vanilla hparam.
- classmethod register(sym_cls)
Use this to register a new traced hparam class for the provided symbol class.
Usage:
@TracedHpRegistry.register(MySymbol) class MyHparam(TracedHp): pass