Skip to content
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

Adding causal prediction code using CACM with demo notebook #729

Merged
merged 14 commits into from
Dec 22, 2022

Conversation

jivatneet
Copy link
Contributor

Adding causal prediction API code and demo using Causally Adaptive Constraint Minimization (CACM).

I was facing issues in ensuring torch compatibility with poetry. Mentioning the exact dependencies here:

  1. pytorch==1.12.1
  2. torchvision==0.13.1
  3. pytorch-lightning==1.7.7

Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: jivatneet <jivatneet@gmail.com>
Copy link
Member

@amit-sharma amit-sharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start for the prediction functionality @jivatneet I have added inline comments. Main feedback is on adding documentation: both in the notebook and inline docstrings.

dowhy/causal_prediction/algorithms/cacm.py Outdated Show resolved Hide resolved
dowhy/causal_prediction/algorithms/erm.py Outdated Show resolved Hide resolved
dowhy/causal_prediction/algorithms/utils.py Show resolved Hide resolved
dowhy/causal_prediction/dataloaders/get_data_loader.py Outdated Show resolved Hide resolved
dowhy/causal_prediction/datasets/mnist.py Show resolved Hide resolved
Signed-off-by: jivatneet <jivatneet@gmail.com>
Copy link
Member

@amit-sharma amit-sharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these edits, @jivatneet. It's very close to a first merge! I've added a few comments.

Let me also tag Emre as a reviewer.

Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: jivatneet <jivatneet@gmail.com>
amit-sharma
amit-sharma previously approved these changes Dec 9, 2022
Copy link
Member

@amit-sharma amit-sharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as a first commit for the prediction API.

Signed-off-by: jivatneet <jivatneet@gmail.com>
Copy link
Collaborator

@andresmor-ms andresmor-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I forgot to publish this review before, sorry

jivatneet and others added 7 commits December 20, 2022 20:45
Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
@amit-sharma amit-sharma merged commit 1ac8354 into py-why:main Dec 22, 2022
Padarn pushed a commit to Padarn/dowhy that referenced this pull request Jan 31, 2023
… notebook (py-why#729)

* add causal prediction using cacm + demo notebook

Signed-off-by: jivatneet <jivatneet@gmail.com>

* Adding causal prediction code using CACM with demo notebook

Signed-off-by: jivatneet <jivatneet@gmail.com>

* addressing comments: fixing documentation in base_algorithm and cacm

Signed-off-by: jivatneet <jivatneet@gmail.com>

* addressing comments: fixing documentation in base_dataset

Signed-off-by: jivatneet <jivatneet@gmail.com>

* rename Algorithm class

Signed-off-by: jivatneet <jivatneet@gmail.com>

* updating base_dataset for format check

Signed-off-by: jivatneet <jivatneet@gmail.com>

* adding exception for optimizer; resolving list bug

Signed-off-by: jivatneet <jivatneet@gmail.com>

* adding docs for base algo

Signed-off-by: jivatneet <jivatneet@gmail.com>

* added torch to dev dependency

* added torchlightning to dev dependency

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* updated poetry.lock

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* updated gpu to devices

Signed-off-by: Amit Sharma <amit_sharma@live.com>

Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Co-authored-by: Amit Sharma <amit_sharma@live.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants