-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CASTER layer implementation #73
CASTER layer implementation #73
Conversation
- only supervised training stage - input dimensionality assumed to be correct
chemicalx/models/caster.py
Outdated
def __init__( | ||
self, | ||
*, | ||
drug_channels: int = 1722, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be set based on dataset and not have a default
chemicalx/models/caster.py
Outdated
) | ||
|
||
# predictor: eight layer NN | ||
predictor_layers_dict = OrderedDict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is very hard to think about. can you just use a list?
chemicalx/models/caster.py
Outdated
""" | ||
Run a forward pass of the CASTER model | ||
|
||
:param drug_pair_features (torch.FloatTensor): functional representation of each drug pair (see unpack method) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to make a named tuple class to document this kind of thing
@andriy-nikolov note I did some reorganization of the code in this PR. Make sure you pull before you begin to work on it again |
Codecov Report
@@ Coverage Diff @@
## main #73 +/- ##
==========================================
+ Coverage 93.87% 94.70% +0.83%
==========================================
Files 29 30 +1
Lines 832 1058 +226
==========================================
+ Hits 781 1002 +221
- Misses 51 56 +5
Continue to review full report at Codecov.
|
* WIP: model forward pass works, not tested * added dropout and batch norm * WIP: made DeepDrug example, not tested * moved to using layers only, not GCN torchdrug model * docstring * added dropout and made context feats optional * added DeepDrug unit test * deepdrug self attribute fix * docstring update * unpack method update (when no context feats used) * isort * fixed test setting (context_channels) * fixed testing without context * black * RST fix * RST fix * more pythonic loop + swap i to _ * removed context feat support in DeepDrug * removed context handling from testing DeepDrug * fixed examples DeepDrug, no context handling, decreased epochs 100->20 * removed unused import * used a wrapper for calling the same layers on pairs of batches * used a wrapper for calling the same layers on pairs of batches * docstring fix * Abstract process applied to left and right sides * Apply black * Cleanup Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
* linting * GCNBMP Scatter Reduction fix * Using Rel Conv Layers instead of RGCN Model (avoid unecessary sum readouts) * Added docstrings and fixed highway update implementation * Make number of relationship configurable * little help of black for linting * Cleaning upuseless imports * Sharing attention between right and left side * Adding reference to GCNBMP docstring * Type hinting everything * Fixing docstring in example * - Removing type hints in docstrings as they were added to signatures - Chunked iteration of the BMP backbone for better readability * Ading more-itertools as a dependecy * Using pairwise for encoder construction * Adding missing docstrings * Fixing linting and precommit hook * Fixing the citation back to what is in main * Tests,formatting,example * Tests,formatting,example * GCNBMP * Cleanup Co-authored-by: kcvc236 <kcvc236@seskscpg057.prim.scp> Co-authored-by: Rozemberczki <kmdb028@astrazeneca.net> Co-authored-by: kcvc236 <kcvc236@seskscpg059.prim.scp> Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
* update: Add deepddi model * update: Add deepddi examples * update: Add deepddi test case * Style: deepddi model * Style: deepddi model * Style: deepddi_examples.py * Update deepddi.py * Update deepddi.py Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
I have several concerns with this PR, would have been nice to do a review first. Most importantly: why does it change the standard interface of the forward() function? I don't see where any of the other things it returns are used |
The paper discusses two types of training techniques - supervised and unsupervised. In the unsupervised setting you could use any type of drug pair dataset. This forward pass allows for both setups, in our experiments we only consider supervised ones. |
Summary
An implementation of the CASTER model layers based on https://github.com/kexinhuang12345/CASTER
Note:
covers only supervised training stage
input dimensionality assumed to be correct and meaningful according to the assumptions of the algorithm
TODO: inclusion of the unsupervised stage (would require a pipeline hook)
TODO: inclusion of the BIOSNAP dataset from the paper
TODO: data loading using the input processing from the paper
Unit tests provided for these changes
Documentation and docstrings added for these changes using the sphinx style
Changes