fusionlab.params.LearnableC¶
- class fusionlab.params.LearnableC[source]¶
Bases:
_BaseCIndicates that the PINN’s physical coefficient \(C\) should be learned (trainable). We actually learn \(\log(C)\) to ensure \(C > 0\). The user supplies an initial_value, and the model initializes:
Trainable \(C\).
In TF mode we keep \(\log C\) as a
tf.Variable, ensuring \(C>0\).In NumPy mode the coefficient cannot be trained, so it degrades gracefully to a fixed float.
\[\log C \;=\; \log(\text{initial\_value}).\]- Parameters:
initial_value (
float) – Strictly positive initial \(C\).- Variables:
initial_value (
float) – The positive starting value for \(C\). Must be strictly positive.
Examples
>>> from fusionlab.params import LearnableC >>> # Learn C, starting from C = 0.01 >>> pinn_coeff = LearnableC(initial_value=0.01) >>> # Learn C, starting from C = 0.001 >>> pinn_coeff_small = LearnableC(initial_value=0.001)
Methods
__init__([initial_value])from_config(cfg)get_config()Attributes
trainableoverridden by concrete classes