tensorly / torch

TensorLy-Torch: Deep Tensor Learning with TensorLy and PyTorch
http://tensorly.org/torch/
BSD 3-Clause "New" or "Revised" License
70 stars 18 forks source link

Reconstructed in from_conv is no showing Reconstructed layers but the factorized layers #5

Closed Silk760 closed 2 years ago

Silk760 commented 3 years ago

Hi,

I am trying to from_conv with reconstructed as implementation choice but the layer showing as a factorized layer not as a reconstructed layer.

''' layer = nn.Conv2d(128,64,3) factorized_layer = tltorch.FactorizedConv.from_conv(layer,implementation='reconstructed') ''' FactorizedConv( in_channels=128, out_channels=64, kernel_size=(3, 3), rank=372, order=2, (weight): CPTensor(shape=(64, 128, 3, 3), rank=372) )

also, I can access its factors, factorized_layer.weight.factors

I don't want that I just want to access the reconstructed layer until I can access layer.weight.data.

Thanks

JeanKossaifi commented 3 years ago

Regardless of the implementation used for the forward pass, the layer is stored in factorized form.

The difference is at the forward pass: either the reconstruction is used and a regular convolution performed with that convolution, or, equivalently, a series of smaller convs is performed, using the factors of the convolution.

What are you trying to achieve?

JeanKossaifi commented 2 years ago

Closing this, feel free to reopen if your issue isn't solved!