You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to create a separate library for each variable through CustomLibrary. This means that my input data consists of n different variables, with shape (time_steps, num_variables). For each ode xi_dot that I want to regress, there is a separate library. My idea is to build library_functions = [
[x0_library], # x0 function library
[x1_library], # x1 function library
[x2_library], # x2 function library
[x3_library], # x3 function library
[x4_library], # x4 function library
[x5_library], # x5 function library
[x6_library], # x6 function library
[x7_library], # x7 function library
]
lib = ps.CustomLibrary(library_functions=library_functions) AttributeError: 'list' object has no attribute 'code'
But this doesn't seem to work, please let me know if I'm missing something, thank you very much for your answer!
My idea is based on the description on the pysindy website:
library_functions (list of mathematical functions) – Functions to include in the library. Default is to use same functions for all variables. Can also be used so that each variable has an associated library, in this case library_functions is shape (n_input_features, num_library_functions)
, but it doesn't seem to work
The text was updated successfully, but these errors were encountered:
BK201-kkk
changed the title
How to use CustomLibrary to ensure that each variable has an associated library?
How to use CustomLibrary to achieve that each variable has an associated library?
Jan 26, 2025
library_functions (list of mathematical functions) – Functions to include in the library. Default is to use same functions for all variables. Can also be used so that each variable has an associated library, in this case library_functions is shape (n_input_features, num_library_functions)
This is a mistake in the documentation. The correct way is to use a GeneralizedLibrary, which is a wrapper that has the specific purpose of controlling how variables and libraries are combined. It has an inputs_per_library argument that handles this.
I try to create a separate library for each variable through CustomLibrary. This means that my input data consists of n different variables, with shape (time_steps, num_variables). For each ode xi_dot that I want to regress, there is a separate library. My idea is to build library_functions = [
[x0_library], # x0 function library
[x1_library], # x1 function library
[x2_library], # x2 function library
[x3_library], # x3 function library
[x4_library], # x4 function library
[x5_library], # x5 function library
[x6_library], # x6 function library
[x7_library], # x7 function library
]
lib = ps.CustomLibrary(library_functions=library_functions)
AttributeError: 'list' object has no attribute 'code'
But this doesn't seem to work, please let me know if I'm missing something, thank you very much for your answer!
My idea is based on the description on the pysindy website:
library_functions (list of mathematical functions) – Functions to include in the library. Default is to use same functions for all variables. Can also be used so that each variable has an associated library, in this case library_functions is shape (n_input_features, num_library_functions)
, but it doesn't seem to work
The text was updated successfully, but these errors were encountered: