Skip to content

Commit

Permalink
🩹Fix for when the backsweep is a parameter rather than constant (glot…
Browse files Browse the repository at this point in the history
…aran#1422)

* Fix for crashing optimizer when the backsweep is a parameter rather than constant

---------

Co-authored-by: s-weigand <s.weigand.phy@gmail.com>
  • Loading branch information
jsnel and s-weigand committed Jun 2, 2024
1 parent 7be4369 commit e16ad5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glotaran/builtin/items/activation/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ def parameters(

scales = self.scale or [1.0] * nr_gaussians
backsweep = self.backsweep is not None
backsweep_period = self.backsweep if backsweep else 0
backsweep_period = float(self.backsweep) if self.backsweep is not None else 0

parameters: list[GaussianActivationParameters] = [
GaussianActivationParameters(
float(center),
float(width),
float(scale),
backsweep,
backsweep_period, # type:ignore[arg-type]
backsweep_period,
)
for center, width, scale in zip(centers, widths, scales)
]
Expand Down

0 comments on commit e16ad5b

Please sign in to comment.