fusionlab.params.LearnableQ

class fusionlab.params.LearnableQ[source]

Bases: BaseLearnable

Learnable Source/Sink term (Q).

Indicates that the PINN’s source/sink term \(Q\) should be learned (trainable) if TensorFlow is available; otherwise acts as a fixed NumPy‐based parameter. Unlike K and Ss, Q may be positive or negative, so we learn it directly (no log‐transform). The user supplies an initial_value, and the object initializes:

\[Q \;=\; ext{initial\_value}.\]

Unconstrained: may be positive or negative.

Examples

>>> q = LearnableQ(0.0)
>>> q.get_value()
0.0
__init__(initial_value=0.0, name=None, trainable=True, **kws)[source]
Parameters:
  • initial_value (float)

  • name (str | None)

  • trainable (bool)

Methods

__init__([initial_value, name, trainable])

from_config(config)

Re-instantiate from get_config().

get_config()

Return a JSON-serialisable dict for tf.keras.

get_value()

Return raw \(Q\) value.

__init__(initial_value=0.0, name=None, trainable=True, **kws)[source]
Parameters:
  • initial_value (float)

  • name (str | None)

  • trainable (bool)

get_value()[source]

Return raw \(Q\) value.

Returns:

Source/sink strength.

Return type:

Union[Tensor, float]