senwu / emmental

A deep learning framework for building multimodal multi-task learning systems.
https://emmental.readthedocs.io
MIT License
109 stars 18 forks source link

force task_to_label_dict to be a dict #106

Closed senwu closed 3 years ago

senwu commented 3 years ago

Description of the problems or issues

Is your pull request related to a problem? Please describe. There is unclear part about task_to_label_dict which can be a dict or a list.

Description of the proposed changes

Force task_to_label_dict to be a dict.

Test plan

Add new e2e test to verify this.

Checklist

codecov[bot] commented 3 years ago

Codecov Report

Merging #106 (24c781e) into master (d6e0342) will increase coverage by 0.77%. The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #106      +/-   ##
==========================================
+ Coverage   85.00%   85.77%   +0.77%     
==========================================
  Files          41       41              
  Lines        2000     2010      +10     
  Branches      428      433       +5     
==========================================
+ Hits         1700     1724      +24     
+ Misses        175      171       -4     
+ Partials      125      115      -10     
Flag Coverage Δ
unittests 85.77% <77.77%> (+0.77%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/emmental/model.py 81.47% <72.00%> (+0.86%) :arrow_up:
src/emmental/data.py 91.50% <90.90%> (+5.66%) :arrow_up:
src/emmental/learner.py 69.96% <0.00%> (+0.99%) :arrow_up:
src/emmental/task.py 87.50% <0.00%> (+3.12%) :arrow_up:
src/emmental/scorer.py 80.00% <0.00%> (+7.50%) :arrow_up: