From 8386eee1575253d341a94fc0ebfb2f433b9a74bf Mon Sep 17 00:00:00 2001 From: The swirl_dynamics Authors Date: Thu, 31 Aug 2023 20:50:03 -0700 Subject: [PATCH] Code update PiperOrigin-RevId: 561839173 --- swirl_dynamics/projects/ergodic/utils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/swirl_dynamics/projects/ergodic/utils.py b/swirl_dynamics/projects/ergodic/utils.py index eff80f3..f6b2a01 100644 --- a/swirl_dynamics/projects/ergodic/utils.py +++ b/swirl_dynamics/projects/ergodic/utils.py @@ -304,3 +304,19 @@ def sample_uniform_spherical_shell( vec /= vec_norm return vec * sampling_radius.reshape(broadcasting_shape) + + +def linear_scale_dissipative_target(inputs: Array, scale: float = 1.0): + """Function to rescale the random input to bias the model. + + Arguments: + inputs: Input point in state space. + scale: Real number in [0, 1] that scales down input. + + Returns: + The rescaled input, scale*input. + + This function is implemented to follow the implementation of the Markov Neural + Operator (MNO). + """ + return scale * inputs