frankhan91 / DeepBSDE

Deep BSDE solver in TensorFlow
MIT License
256 stars 128 forks source link

Issue with Equation.sample method when in 1 dimension #4

Closed BrownianNotion closed 2 years ago

BrownianNotion commented 3 years ago

Hi Frank, awesome paper and very clean code, thank you for sharing it publicly!

There seems to be an issue with the sample method of the Equation class when considering 1-dimensional equations (eg. line 39 of Equation.py). Unfortunately, scipy's multivariate normal seems to remove the second dimension when self.dim=1, resulting in an indexing error when doing x_sample[:, :, 0] as x_sample will be of shape (num_sample, self.num_time_interval). I am running scipy 1.6.2.

frankhan91 commented 3 years ago

Yes, you are right. Thank you for reporting this issue. I will fix this problem when I finish travel two weeks later.