Skip to content

Commit 6aa5d64

Browse files
committed
fix minor typehint error
1 parent fbbbd01 commit 6aa5d64

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

example/GW170817_heterodyne.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
)
9494

9595
# The following only works if every prior has xmin and xmax property, which is OK for Uniform and Powerlaw
96-
bounds = jnp.array([[p.xmin, p.xmax] for p in prior.priors]).T
96+
bounds = jnp.array([[p.xmin, p.xmax] for p in prior.priors])
9797

9898
### Create likelihood object
9999
likelihood = HeterodynedTransientLikelihoodFD([H1, L1, V1], prior=prior, bounds=bounds, waveform=RippleIMRPhenomD(), trigger_time=gps, duration=T, n_bins=500)
@@ -116,7 +116,6 @@
116116
jim = Jim(
117117
likelihood,
118118
prior,
119-
n_loop_pretraining=0,
120119
n_loop_training=200,
121120
n_loop_production=20,
122121
n_local_steps=200,

src/jimgw/prior.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,21 @@ def new_transform(param):
167167
self.naming[0]: (local_transform[self.naming[0]][0], new_transform)
168168
}
169169

170-
def to_range(self, x: dict[str, Float]) -> Float:
170+
def to_range(self, x: Float) -> Float:
171171
"""
172172
Transform the parameters to the range of the prior.
173173
174174
Parameters
175175
----------
176-
x : dict
177-
A dictionary of parameters. Names should match the ones in the prior.
176+
x : Float
177+
The parameters to transform.
178178
179179
Returns
180180
-------
181181
x : dict
182182
A dictionary of parameters with the transforms applied.
183183
"""
184-
return (self.xmax - self.xmin) / (1 + jnp.exp(-x[self.naming[0]])) + self.xmin
184+
return (self.xmax - self.xmin) / (1 + jnp.exp(-x)) + self.xmin
185185

186186
def sample(
187187
self, rng_key: PRNGKeyArray, n_samples: int

0 commit comments

Comments
 (0)