Skip to content

Commit aff4bf8

Browse files
author
fabioferreira
committed
Document dependencies
1 parent 729c14e commit aff4bf8

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ Beyond estimating conditional probability densities, the package features extens
2424

2525
For the parametric models (MDN, KMN, NF), we recommend the usage of noise regularization which is supported by our implementation. For details, we refer to the paper [Noise Regularization for Conditional Density Estimation](https://arxiv.org/abs/1907.08982).
2626

27+
## Dependencies
28+
29+
- Python 3.11
30+
- PyTorch
31+
- NumPy
32+
- pandas
33+
- Edward (legacy TensorFlow analyses)
34+
2735
## Installation
2836

29-
Clone the repository and run the provided script to create the `cde-pytorch` Conda environment (Python 3.11/3.10 with CPU PyTorch plus the pinned NumPy/SciPy versions that are tested with CDE):
37+
Clone the repository and run the provided script to create the `cde-pytorch` Conda environment (Python 3.11 with CPU PyTorch plus the pinned NumPy/SciPy versions that are tested with CDE):
3038
```bash
3139
bash scripts/setup_pytorch_env.sh
3240
```

cde/model_fitting/divergences.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ def _div(x_tiled, y_samples):
9898
for i in range(x_cond.shape[0]):
9999
x = np.tile(x_cond[i].reshape((1, x_cond[i].shape[0])), (n_samples, 1))
100100
func = lambda y: _make_2d(_div(x, y))
101-
result = mc_integration_student_t(func, q.ndim_y, n_samples=n_samples, loc_proposal=mu_proposal, scale_proposal=std_proposal)
102-
result = np.asarray(result).reshape(-1)
103-
if n_measures == 1:
104-
distances[i] = result[0]
105-
else:
106-
distances[i] = result[:n_measures]
101+
result = mc_integration_student_t(func, q.ndim_y, n_samples=n_samples, loc_proposal=mu_proposal, scale_proposal=std_proposal)
102+
result = np.asarray(result).reshape(-1)
103+
if n_measures == 1:
104+
distances[i] = result[0]
105+
else:
106+
distances[i] = result[:n_measures]
107107
assert distances.shape[0] == x_cond.shape[0]
108108
return distances
109109

0 commit comments

Comments
 (0)