senwu / emmental

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

[model/predict] Add support for different types of action outputs #113

Open ANarayan opened 2 years ago

ANarayan commented 2 years ago

This PR adds support processing action outputs of different types. The current implementation expects that all action outputs are of type tensor. Here, we expand support for outputs of type dict. This PR also adds a new utils function (merge_objects) which merges different types of objects.

codecov[bot] commented 2 years ago

Codecov Report

Merging #113 (7f76dbf) into master (03c80bc) will increase coverage by 0.10%. The diff coverage is 96.66%.

:exclamation: Current head 7f76dbf differs from pull request most recent head 044ed8c. Consider uploading reports for the commit 044ed8c to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   91.21%   91.31%   +0.10%     
==========================================
  Files          40       40              
  Lines        1991     2039      +48     
  Branches      425      446      +21     
==========================================
+ Hits         1816     1862      +46     
  Misses        101      101              
- Partials       74       76       +2     
Flag Coverage Δ
unittests 91.31% <96.66%> (+0.10%) :arrow_up:

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

Impacted Files Coverage Δ
src/emmental/meta.py 84.46% <ø> (ø)
src/emmental/utils/parse_args.py 99.31% <ø> (ø)
src/emmental/utils/utils.py 96.70% <95.91%> (-0.38%) :arrow_down:
src/emmental/logging/checkpointer.py 93.33% <100.00%> (ø)
src/emmental/model.py 88.46% <100.00%> (+0.11%) :arrow_up: