Skip to content

Commit b9aa5b8

Browse files
Added formula to sinusodial prior distributions
1 parent 014ac07 commit b9aa5b8

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

normflows/distributions/prior.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def __init__(self, scale, period):
150150
given by
151151
152152
```
153-
log(p) = - 1/2 * ((z[1] - w_1(z)) / (2 * scale)) ** 2
154153
w_1(z) = sin(2*pi / period * z[0])
154+
log(p) = - 1/2 * ((z[1] - w_1(z)) / (2 * scale)) ** 2
155155
```
156156
157157
Args:
@@ -192,6 +192,13 @@ def log_prob(self, z):
192192
class Sinusoidal_gap(PriorDistribution):
193193
def __init__(self, scale, period):
194194
"""Distribution 2d with sinusoidal density with gap
195+
given by
196+
197+
```
198+
w_1(z) = sin(2*pi / period * z[0])
199+
w_2(z) = 3 * exp(-0.5 * ((z[0] - 1) / 0.6) ** 2)
200+
log(p) = -log(exp(-0.5 * ((z[1] - w_1(z)) / 0.35) ** 2) + exp(-0.5 * ((z[1] - w_1(z) + w_2(z)) / 0.35) ** 2))
201+
```
195202
196203
Args:
197204
loc: distance of modes from the origin
@@ -236,6 +243,13 @@ def log_prob(self, z):
236243
class Sinusoidal_split(PriorDistribution):
237244
def __init__(self, scale, period):
238245
"""Distribution 2d with sinusoidal density with split
246+
given by
247+
248+
```
249+
w_1(z) = sin(2*pi / period * z[0])
250+
w_3(z) = 3 * sigmoid((z[0] - 1) / 0.3)
251+
log(p) = -log(exp(-0.5 * ((z[1] - w_1(z)) / 0.4) ** 2) + exp(-0.5 * ((z[1] - w_1(z) + w_3(z)) / 0.35) ** 2))
252+
```
239253
240254
Args:
241255
loc: distance of modes from the origin

0 commit comments

Comments
 (0)