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
Hi I'm trying to apply 'parameterization constraints' as detailed in this tutorial. The problem is that this FNO library is rather unusual as it appears that SpectralConv doesn't have traditional "parameters", because when I try to do:
ValueError: Module 'SpectralConv(
(weight): ModuleList(
(0): ComplexDenseTensor(shape=torch.Size([3, 3, 3]), rank=None)
)
)' does not have a parameter, a buffer, or a parametrized element with name 'weight'
I've tried various troubleshooting methods like:
Using the spectral_conv.named_parameters() name of the FNO layer parameters (called "weight.0.tensor")
Trying to access spectral_conv[0].weight, which fails because it claims that the class "SubConv object has no attribute weight" even though it is clearly defined as a property... no idea whats happening here.
And trying to manually convert the SpectralConv.weight[0] into a parameter but apparently a ComplexDenseTensor isn't an actual torch.Tensor since it doesn't implement detach()...
My Question: is it at all possible to apply 'parameterization constraints' as described in this tutorial?
The text was updated successfully, but these errors were encountered:
Hi, I think a little about it and, in my opinion, you can't do this by a "user" of the library. I think that it is simpler to fork the library and make the modification that you want directly in the source code.
If I understand well you want to impose some constraint on the weight tensor within the spectral operator...
So, in your particular case, you can go to neuralop/layers/spectral_convolution.py and make the modification that you want directly to the weight variable of the class SpectralConv; between line $329$ and line $356$ of the mentioned file I think that you can find what you need.
Let me know if it is helpful and if you can implement what you want... If you want to provide more details about parameterization that you want to comment we can try to go beyond the code.
Hi I'm trying to apply 'parameterization constraints' as detailed in this tutorial. The problem is that this FNO library is rather unusual as it appears that SpectralConv doesn't have traditional "parameters", because when I try to do:
It fails saying that:
I've tried various troubleshooting methods like:
spectral_conv[0].weight
, which fails because it claims that the class "SubConv object has no attribute weight" even though it is clearly defined as a property... no idea whats happening here.ComplexDenseTensor
isn't an actualtorch.Tensor
since it doesn't implementdetach()
...My Question: is it at all possible to apply 'parameterization constraints' as described in this tutorial?
The text was updated successfully, but these errors were encountered: