Neutone / neutone_sdk

Join the community on Discord for more discussions around Neutone! https://discord.gg/VHSMzb8Wqp
GNU Lesser General Public License v2.1
470 stars 22 forks source link

Aggregate param fix #26

Closed hyakuchiki closed 1 year ago

hyakuchiki commented 1 year ago

RAVE models have been sounding funny with the recent SDK, and it seems that aggregate_params was the problem. torch.mean was using the same tensor for input and output, which causes some weird behaviors as illustrated below:

a = torch.Tensor([1,2,3]) # sum should be 6
b = a[0:1]
torch.sum(a, dim=0, keepdim=True, out=b)
a, b # [5,2,3], [5]

which throws off the parameter values. Also, render_audio_sample was referring to torch as torch and not tr (as imported).

christhetree commented 1 year ago

Damn this is really annoying. I was worried something like this would happen when writing it, but must have missed it during my tests with floating point numbers. Thanks for finding this!