geoprior.params.BaseFixed#

class geoprior.params.BaseFixed(value, name, log_transform=False, non_negative=True, **kws)[source]#

Bases: ABC

Abstract base for fixed physical parameters.

Parameters:
  • value (float) – Fixed numeric value for the parameter.

  • name (str) – Unique identifier for the variable.

  • log_transform (bool, optional) – If True, store in log-space for positivity constraint and apply exp() when retrieving value, by default False.

  • non_negative (bool, optional) – If True, ensures value cannot be negative, by default True. Only enforced when log_transform=False.

Variables:
  • value (float) – The fixed parameter value.

  • name (str) – Variable name in the computation graph.

  • log_transform (bool) – Whether to apply log transform for positivity.

  • non_negative (bool) – Whether negative values are allowed.

  • trainable (bool) – Always False for fixed parameters.

Examples

>>> param = FixedGammaW(value=9810.0)
>>> value = param.get_value()
__init__(value, name, log_transform=False, non_negative=True, **kws)[source]#
Parameters:

Methods

__init__(value, name[, log_transform, ...])

from_config(config)

Re-instantiate from configuration dict.

get_config()

Return a JSON-serialisable dict for tf.keras serialization.

get_value()

Retrieve the fixed parameter value.

__init__(value, name, log_transform=False, non_negative=True, **kws)[source]#
Parameters:
get_value()[source]#

Retrieve the fixed parameter value.

Returns:

The parameter value, with exp() applied if log_transform=True.

Return type:

Union[Tensor, float]

get_config()[source]#

Return a JSON-serialisable dict for tf.keras serialization.

Return type:

dict[str, Any]

classmethod from_config(config)[source]#

Re-instantiate from configuration dict.

Parameters:

config (dict[str, Any])

Return type:

BaseFixed