This PR refactors tasks into reusable components that will make it easier to define new tasks and methods.
The PR is pretty big, but a lot of it is moving code around (or deleting repeated code):
Creates a notion of Conditional, implements TemperatureConditional, MultiObjectiveWeightedPreferences, FocusRegionConditional
Separates the commonalities between seh_frag and seh_frag_moo into a more generic StandardOnlineTrainer that is meant to be easily subclassed for new tasks.
Adds some implementation notes and comments
Adds a validate_batch routine that's useful for debugging, e.g. new environments and datasets
Also fixes some bugs:
Makes valid_offline_ratio a flag and sets it explicitly in tasks where it wasn't properly set
first_graph_idx was incorrectly calculated in SubTB (affected logging of logZ values)
QM9Dataset was returning the wrong shape for its rewards
Adds a allow_5_valence_nitrogen flag to MolBuildingEnvContext, this is needed in some cases, see tasks/qm9.py.
Adds an explicit stop_mask to MolBuildingEnvContext.graph_to_Data
Fixes incorrect default objective name in seh_frag_moo
Fixes the default configurations in the tasks' main that hadn't been updated
Fixes a number of routines where focus_cond was assumed to exist (but we can now turn it off).
This PR refactors tasks into reusable components that will make it easier to define new tasks and methods.
The PR is pretty big, but a lot of it is moving code around (or deleting repeated code):
Conditional
, implementsTemperatureConditional
,MultiObjectiveWeightedPreferences
,FocusRegionConditional
seh_frag
andseh_frag_moo
into a more genericStandardOnlineTrainer
that is meant to be easily subclassed for new tasks.validate_batch
routine that's useful for debugging, e.g. new environments and datasetsAlso fixes some bugs:
valid_offline_ratio
a flag and sets it explicitly in tasks where it wasn't properly setfirst_graph_idx
was incorrectly calculated in SubTB (affected logging of logZ values)allow_5_valence_nitrogen
flag toMolBuildingEnvContext
, this is needed in some cases, seetasks/qm9.py
.stop_mask
toMolBuildingEnvContext.graph_to_Data
seh_frag_moo
main
that hadn't been updatedfocus_cond
was assumed to exist (but we can now turn it off).