private-pgm icon indicating copy to clipboard operation
private-pgm copied to clipboard

torch_example.py not working

Open jakee417 opened this issue 2 years ago • 0 comments

I am trying to run torch_example.py but I am getting the following error:

Traceback (most recent call last):
  File "/Users/jakeetaylor/private-pgm/examples/torch_example.py", line 68, in <module>
    model = engine.estimate(measurements, total=total, engine='RDA')
  File "/Users/jakeetaylor/private-pgm/.venv/lib/python3.10/site-packages/mbi/inference.py", line 77, in estimate
    self.dual_averaging(measurements, total, **options)
  File "/Users/jakeetaylor/private-pgm/.venv/lib/python3.10/site-packages/mbi/inference.py", line 180, in dual_averaging
    _, g = self._marginal_loss(u) # not interested in loss of this query point
  File "/Users/jakeetaylor/private-pgm/.venv/lib/python3.10/site-packages/mbi/inference.py", line 270, in _marginal_loss
    diff = c*(Q @ x - y)
TypeError: unsupported operand type(s) for -: 'numpy.ndarray' and 'Tensor'

jakee417 avatar Dec 27 '23 17:12 jakee417