BaderLab / saber

Saber is a deep-learning based tool for information extraction in the biomedical domain. Pull requests are welcome! Note: this is a work in progress. Many things are broken, and the codebase is not stable.
https://baderlab.github.io/saber/
MIT License
102 stars 17 forks source link

Faster att mask gen #176

Closed JohnGiorgi closed 5 years ago

JohnGiorgi commented 5 years ago

Overview

This PR is a combination of a few things, just rolled them into one as we are rushing toward the ICLR deadline.

  1. Replaces list comprehensions used to generate attention masks with torch.where. This is many times faster.
  2. Remove the transformer layer. It was accounting for almost no performance (and actually hurting performance in some cases).
  3. Clean up the optimizer initialization code. It is now better written to prevent weight decay being applied to normalization layers.

Something funky happen and I had to push the same commits twice.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 494


Totals Coverage Status
Change from base Build 490: 0.0%
Covered Lines:
Relevant Lines: 0

💛 - Coveralls
coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 496


Changes Missing Coverage Covered Lines Changed/Added Lines %
saber/utils/bert_utils.py 10 11 90.91%
<!-- Total: 13 14 92.86% -->
Totals Coverage Status
Change from base Build 490: 0.0%
Covered Lines: 1434
Relevant Lines: 1628

💛 - Coveralls