Closed senwu closed 2 years ago
Merging #116 (b3035f4) into master (6cad215) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #116 +/- ##
=======================================
Coverage 92.12% 92.12%
=======================================
Files 40 40
Lines 2018 2018
Branches 431 431
=======================================
Hits 1859 1859
Misses 94 94
Partials 65 65
Flag | Coverage Δ | |
---|---|---|
unittests | 92.12% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
src/emmental/model.py | 93.78% <ø> (ø) |
|
src/emmental/__init__.py | 100.00% <100.00%> (ø) |
|
src/emmental/task.py | 100.00% <100.00%> (ø) |
Description of the proposed changes
To make Emmental more extendable and easy to use for downstream tasks.
Action
andBatch
to make the APIs more modularized.Action
are objects that populate thetask_flow
sequence. It has three attributes: name, module and inputs where name is the name of the action, module is the module name of the action and inputs is the inputs to the action. By introducing a class for specifying actions in thetask_flow
, we standardize its definition. Moreover,Action
enables more user flexibility in specifying a task flow as we can now support a wider-range of formats for the input attribute of atask_flow
as discussed in (2).Batch
is the object that is returned from the EmmentalScheduler
. EachBatch
object has 6 attributes: uids (uids of the samples), X_dict (input features of the samples), Y_dict (output of the samples), task_to_label_dict (the task to label mapping), data_name (name of the dataset that samples come from), and split (the split information). By defining theBatch
class, we unify and standardize the training scheduler interface by ensuring a consistent output format for all schedulers.task_flow
more flexible by supporting more formats for specifying inputs to each module.input1
's output as input for current action.Few emmental.EmmentalTaskFlowAction examples:
This design also can be applied to action_outputs, here are few example:
Test plan
Pass the existing tests.
Checklist