Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changelog/18.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
+ include support for logistic-decay
+ we added three new classes/functions to the API in the module `convergence`
+ `LogisticDecaySplineHelper`
+ `LogisticDecaySplineHelperDerivative`
+ `get_logistic_decay_harmonised_spline`
+ whereby the function `get_logistic_decay_harmonised_spline` is mainly meant as user-interface
This function can be used as value for the `get_harmonise_spline` parameter in `harmonise`.
The function takes the same arguments as `get_cosine_decay_harmonised_spline` and additionally a
`slope` and `shift` argument.
+ These arguments determine slope and location of the logistic function and can be passed using
`functools.partial(get_logistic_decay_harmonised_spline, slope = 0., shift = 0.)`
+ An example use-case is added to the `getting-started-tutorial`.
Comment on lines +1 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+ include support for logistic-decay
+ we added three new classes/functions to the API in the module `convergence`
+ `LogisticDecaySplineHelper`
+ `LogisticDecaySplineHelperDerivative`
+ `get_logistic_decay_harmonised_spline`
+ whereby the function `get_logistic_decay_harmonised_spline` is mainly meant as user-interface
This function can be used as value for the `get_harmonise_spline` parameter in `harmonise`.
The function takes the same arguments as `get_cosine_decay_harmonised_spline` and additionally a
`slope` and `shift` argument.
+ These arguments determine slope and location of the logistic function and can be passed using
`functools.partial(get_logistic_decay_harmonised_spline, slope = 0., shift = 0.)`
+ An example use-case is added to the `getting-started-tutorial`.
+ Include supported for logistic-decay
+ Added new features to [convergence][gradient_aware_harmonisation.convergence]
+ [LogisticDecaySplineHelper][gradient_aware_harmonisation.convergence.LogisticDecaySplineHelper]
+ [LogisticDecaySplineHelperDerivative][gradient_aware_harmonisation.convergence.LogisticDecaySplineHelperDerivative]
+ [get_logistic_decay_harmonised_spline][gradient_aware_harmonisation.convergence.get_logistic_decay_harmonised_spline]
+ The function [get_logistic_decay_harmonised_spline][gradient_aware_harmonisation.convergence.get_logistic_decay_harmonised_spline] is an adapter between the underlying classes and the interface required for the `get_harmonise_spline` parameter in [harmonise][gradient_aware_harmonisation.harmonise].
The function takes the same arguments as [get_cosine_decay_harmonised_spline][gradient_aware_harmonisation.convergence.get_cosine_decay_harmonised_spline] and additional
`slope` and `shift` arguments. These arguments determine the slope and location of the logistic function and can be can be 'pre-passed' to the function using [functools.partial](https://docs.python.org/3/library/functools.html#functools.partial) e.g. `harmonise(..., get_harmonise_spline=functools.partial(get_logistic_decay_harmonised_spline, slope = 0., shift = 0.)...)`
+ An example use-case is included in the [getting started tutorial][gradient-aware-harmonisation-getting-started].

Same reasoning as #16 (comment)

25 changes: 25 additions & 0 deletions docs/tutorials/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from gradient_aware_harmonisation import harmonise
from gradient_aware_harmonisation.convergence import (
get_logistic_decay_harmonised_spline,
get_polynomial_decay_harmonised_spline,
)
from gradient_aware_harmonisation.plotting import plotting
Expand Down Expand Up @@ -115,6 +116,30 @@
get_harmonised_spline=partial(get_polynomial_decay_harmonised_spline, power=2.0),
)

plotting(
harmonisee_timeseries,
target_timeseries,
harmonised_timeseries,
harmonisation_time,
convergence_time,
)

# %% [markdown]
# ### Use logistic-decay

# %%
convergence_time = 8.0

harmonised_timeseries = harmonise(
target_timeseries=target_timeseries,
harmonisee_timeseries=harmonisee_timeseries,
harmonisation_time=harmonisation_time,
convergence_time=convergence_time,
get_harmonised_spline=partial(
get_logistic_decay_harmonised_spline, slope=-1.0, shift=-8.0
),
)

plotting(
harmonisee_timeseries,
target_timeseries,
Expand Down
Loading