-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace fooof with specparam #335
Comments
Good catch with the renaming. Is the print statement still in the Yes.. and it would definitely makes sense to drop the reinitialization. I think I looked into that at one point, and in order to prevent updating a forked version of fooof/specparam, I decided to keep it like that.. But maybe the syntax changed now and it's possible to use repetitively an already initialized object. |
Hi @timonmerk , I was working on the FOOOF change and I noticed sth: Numpy is raising a lot of RuntimeWarnings due to this line: params = params ** (1 / fm.get_params("aperiodic_params", "exponent")) This is because this is equivalent of trying to take the root of a negative number, which would produce an imaginary number and instead produces But I don't understand the significance of the knee parameter being negative, my intuition says, seeing as most negative values are very close to zero, that when this happens it means that the data did not have a bend, so there is no features_compute[f_name] = np.nan_to_num(params) which converts the resulting # If knee parameter is negative, set knee frequency to 0
if params < 0:
params = 0
else:
params = params ** (1 / fm.get_params("aperiodic_params", "exponent")) Won't throw warnings and makes the calculation a bit more explicit I think. Also I tested that the warnings happened with the real experimental data by loading the example dataset There was also another problem arising with my artifical random dataset: when the exponent And setting a However, in the real dataset a new problem appeared: I'm getting a lot of |
The people that maintain the
fooof
package have renamed it tospecparam
and are in the process of releasing a new version.If we don't need the functionality, we should not have a reason to change, BUT, there is a probem: they forgot a random print in their code which is super-annoying when fooof feature is activated since it prints to the console
So it might be worth to update just to get rid of that.
On the brighter side, thanks to this I realized that the FOOOF model is initialized once per batch, which is probably not necessary, just initialize once and call
fit
once per batch.Reference to make the change to the new version: fooof-tools/fooof#205
EDIT: Ok so I realized that the print is not there anymore, maybe because I re-built my environment and it's possible that it was myself who put the print there months ago doing some research into the FOOOF feature. I feel like an idiot.
The text was updated successfully, but these errors were encountered: