-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix error to signal loss in notebook #12
base: main
Are you sure you want to change the base?
Conversation
The pre emphasis filter looks correct, but I'm not getting the same training result as the original method of splitting the data without the data loader class. I tried with the 0.01 learning rate and with the smaller one. One part I don't quite understand, in your WindowArray class, the x_out and y_out are calculated the same way, but each input of x should be of length input_size, and each out y should be a single output. In that way, the previous input_size samples are used to predict the current single sample. I'll need to read up on the TimeDistributed layer, not familiar with that one. Unfortunately I'm getting worse results than before, but I'm not exactly sure why that is yet. |
I think part of the problem is that the LSTM model I made isn't what they developed in the paper. They use a single input, single output stateful LSTM model, where I'm using a non stateful multiple input, single output LSTM model with two conv1d input layers. The paper uses stateful LSTMs to have information of previous samples, where I'm using an input of input_size (default 120) to train the model on what the next sample should be. It could be that the model I made won't work with the same error to signal equation from the paper, because it's made for a different model. I'll run some more tests, but when I compared the plots and the sound of the mse to the error to signal (with same params and train time), it wasn't as good. I'll also try mae and see how that performs. |
I would be interested to see if using the stateful LSTM -> dense layers from the papers with your new code would work. I tried to get the stateful lstms working but wasn't able to. There is another issue that might have some useful info for doing this: #8 (comment) |
Yeah, that's a good point, it is different. If you do want a single output model rather than multi output, then it's probably better not to use error_to_signal loss, I think (out of curiosity, is it preferred to keep it that single output?). By the way, could you post a plot of a model that performs well? I've been trying training the model with an even lower learning rate and for more epochs, and it seems to look promising. I'll post a plot of that soon (I'm assuming you use the output of |
That's the same thing I get with the old code and the TS9 example. Here is one (also TS9 sample) using the the old code and loss=mse, with the lowered model settings from the SmartAmpPro colab notebook. I left error to signal as a metric, and it ends up being about the same as using loss=error_to_signal. I think having the multiple sample input is more important to prediction than the choice of loss function for this model. |
I ran some more tests using mse and mae for loss, this time by creating models for SmartAmpPro. When using the same settings (3 epochs, 24 hidden units) they sound really close. For the easy to train sounds (like the TS9) I can barely tell a difference between those and the error to signal version. For high gain sounds the difference is more noticeable, but they all sound good. I'll post the models to let you try them out. @jmiller656 what are your thoughts on mse vs mae? Sorry for leading you down the rabbit hole on error to signal, but what you already added to this colab script works great, and I'll probably propagate it to the local training and SmartAmpPro training. |
Here are a few models using mse for loss, and with higher epochs (30 - 50). See the new colab script I added to the SmartAmpPro repo (train_colab_mse.ipynb). |
Oh sweet! (sorry I disappeared for a bit there, busy week) As for |
This fixes issues with #10 and #11 , and is also related to GuitarML/PedalNetRT#16
This makes the training a sequence to sequence task (predict n output steps for n input steps) and also fixes a problem with the pre-emphasis filter that would cause high / infinite loss values.
In some listening tests, I've found that using
mse
andmae
still seems to sound better thanerror_to_signal
and also seem to optimizeerror_to_signal
as a metric better than just usingerror_to_signal
as a loss function. I suspect adjusting the learning rate (lowering it a lot) could help theerror_to_signal
loss work much better.The next things I plan to do are looking into the improved loss functions and pre-emphasis filters in this paper as well as tuning the learning rate for
error_to_signal
loss