Comments (1)
Hi @bbb801
Could you please modify the dynamic memory into:
# dynamic memory
DM_keys = queries[:, :-1, :]
DM_values = prev_drugs[:, :-1, :]
which would make the code runs through. These two lines mean that we use the drugs from visit 1 to visit N-1, so the DM_keys and DM_values should both have :-1
.
The above is for the GAMENetLayer class. Also, we have improved the GAMENet class, which replaces the target calculation blocks:
# previous block
curr_drugs = [p[-1] for p in drugs_hist]
curr_drugs = batch_to_multihot(curr_drugs, label_size)
curr_drugs = curr_drugs.to(self.device)
# new block
curr_drugs = self.prepare_labels(drugs, self.label_tokenizer)
Please refer to our current new master branch.
from pyhealth.
Related Issues (20)
- Cannot download 'https://storage.googleapis.com/pyhealth/resource/NDC_to_ATC.csv' HOT 5
- question about MIMIC-III in drug recommendation task HOT 4
- The results obtained with pyhealth are much lower than in the paper. HOT 6
- The results of SafeDrug model differ significantly from those in the paper. HOT 4
- Performance of SafeDrug and Molerec HOT 4
- a question about metrics HOT 1
- wrong code in pyhealth\metrics\drug_recommendation.py HOT 1
- pip install version HOT 1
- Does the inner map cotains all the icd code id? HOT 5
- Getting error while loading OMOP dataset HOT 2
- Bug in SafeDrug HOT 2
- Use Pretrained Model HOT 1
- no such thing SampleDataset HOT 1
- Does models support text? HOT 5
- ImportError: cannot import name 'MIMIC3BaseDataset' from 'pyhealth.datasets' HOT 1
- RxNorm codes hierarchy HOT 1
- HALO and EHR synthetic task HOT 1
- DDI of eICU dataset and omop dataset HOT 2
- drugrec for OMOP datasets doesn't work HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyhealth.