tpapp / TransformVariables.jl

Transformations to contrained variables from ℝⁿ.
Other
66 stars 14 forks source link

Feature Idea: scaling factor for ShiftedExp #95

Open scheidan opened 2 years ago

scheidan commented 2 years ago

It would be useful, if we can optionally define a scale to ShiftedExp. For example, if we have two parameter a and b that are both positive, but have very different scales, we could write:

t = as((a = as(Real, 0, ∞, scale=1),
        b = as(Real, 0, ∞, scale=1000)))

which would map to shift + exp(x/scale).

Having similar scales helps with optimization and sampling.

(Sorry for opening so many issues today. Your package has been very useful for me!)

tpapp commented 2 years ago

Good idea, will do it when I have some time.

tpapp commented 2 years ago

Thanks for the issue and the PR. Ideally I would like to deal with this in a modular way, eg encoding this transformation as

Shift(x) ∘ Exp() ∘ Scale(y) # hypothetical, currently nonexistent API

I will be refactoring this package soon --- do you need this feature now, or can it wait? (I am happy to add it now, just let me know).

scheidan commented 2 years ago

Such a modular approach sounds great! It's not particularly urgent for me. I'm looking forward to the refactored version!