Replies: 1 comment 4 replies
-
Unfortunately, predict/score are not implemented for WeakPDELibrary. See example 12, in the markdown that discusses "for weak form, model.predict returns a prediction of the weak form of x_dot, rather than a prediction of x_dot." You need to manually assign the coefficients discovered from the weak form into another model |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all!
I am using the ps.WeakPDELibrary in combination with the SR3 optimizer for my model, but i am obtaining different results using the model.score() everytime i run it. It varies a lot, with some really good fits, alternated by poorly fit models. I think this has to do with the "If you initialize a new PDE library, a new set of subdomains is randomly chosen" (as stated in the Weak/Integral SINDy Feature Overview example). However, I want to enhance reproducability, thus wanting to eliminate the random factor in the set of subdomains. I've tried setting np.random.seed and random.seed, but have yet to see replicable results. Is there an option to reduce the randomness in the creation of the library?
This is the code I use:
opt = ps.SR3(
threshold=0.005,
thresholder="l1",
max_iter=1000,
normalize_columns=False,
tol=1e-1)
ode_lib = ps.WeakPDELibrary(
model_opt = ps.SINDy(feature_library=ode_lib, optimizer=opt)
model_opt.fit(normalized_transformed_data, t=time_list, multiple_trajectories=True)
print("R2 score", model_opt.score(normalized_transformed_data, t=time_list, multiple_trajectories=True))
Kind regards,
Thijs
Beta Was this translation helpful? Give feedback.
All reactions