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

Use numpy tile instead of matrix #1170

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dowhy/gcm/stats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Callable, List, Optional, Union

import numpy as np
from numpy.matlib import repmat
from scipy import stats
from sklearn.linear_model import LinearRegression

Expand Down Expand Up @@ -146,7 +145,7 @@ def marginal_expectation(
# baseline_noise_samples.shape[0] * feature_samples.shape[0]. Here, we reduce it to
# batch_size * feature_samples.shape[0]. If the batch_size would be set 1, then each baseline_noise_samples is
# evaluated one by one in a for-loop.
inputs = repmat(feature_samples, batch_size, 1)
inputs = np.tile(feature_samples, (batch_size, 1))
for offset in range(0, baseline_samples.shape[0], batch_size):
# Each batch consist of at most batch_size * feature_samples.shape[0] many samples. If there are multiple
# batches, the offset indicates the index of the current baseline_noise_samples that has not been evaluated yet.
Expand Down