Can't get the real weights of the layers #156
-
when i use analysis_transform._layers[0].kernel and analysis_transform._layers[0].get_weights() the two functions, I get different weight. If i use analysis_transform._layers[0].kernel this function, i can get the real weights,but this kernel is read only that i can't modify them. And if i use get_weights() and set_weighs() , i get the wrong weights |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, this is because we use kernel DFT reparameterization by default, to improve training stability. So You can get the kernel using Or you can turn off RDFT reparameterization by instantiating the layer with the keyword |
Beta Was this translation helpful? Give feedback.
Hi, this is because we use kernel DFT reparameterization by default, to improve training stability. So
.get_weights()
will return the DFTs of the kernels, and.kernel
will return the kernel itself.You can get the kernel using
layer.kernel
, and set it again usinglayer.kernel_parameter = RDFTParameter(kernel, name='kernel')
.Or you can turn off RDFT reparameterization by instantiating the layer with the keyword
kernel_parameter='variable'
.