Skip to content

Commit

Permalink
Added formula to sinusodial prior distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentStimper committed Jan 22, 2023
1 parent 014ac07 commit b9aa5b8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion normflows/distributions/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def __init__(self, scale, period):
given by
```
log(p) = - 1/2 * ((z[1] - w_1(z)) / (2 * scale)) ** 2
w_1(z) = sin(2*pi / period * z[0])
log(p) = - 1/2 * ((z[1] - w_1(z)) / (2 * scale)) ** 2
```
Args:
Expand Down Expand Up @@ -192,6 +192,13 @@ def log_prob(self, z):
class Sinusoidal_gap(PriorDistribution):
def __init__(self, scale, period):
"""Distribution 2d with sinusoidal density with gap
given by
```
w_1(z) = sin(2*pi / period * z[0])
w_2(z) = 3 * exp(-0.5 * ((z[0] - 1) / 0.6) ** 2)
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))
```
Args:
loc: distance of modes from the origin
Expand Down Expand Up @@ -236,6 +243,13 @@ def log_prob(self, z):
class Sinusoidal_split(PriorDistribution):
def __init__(self, scale, period):
"""Distribution 2d with sinusoidal density with split
given by
```
w_1(z) = sin(2*pi / period * z[0])
w_3(z) = 3 * sigmoid((z[0] - 1) / 0.3)
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))
```
Args:
loc: distance of modes from the origin
Expand Down

0 comments on commit b9aa5b8

Please sign in to comment.