Closed whisperLiang closed 2 months ago
Here is the code:
import torch import torchvision import torchlens as tl
model = torchvision.models.alexnet(pretrained=True) x = torch.rand(1, 3, 224, 224) model_history = tl.log_forward_pass(model, x, vis_opt='unrolled', save_function_args=True) layer_list = model_history.layer_list print(layer_list[-1]) print(model_history)
In TorchLens the output layer is always just a copy of the final layer. So it should indeed be the same.
Ok, thanks!
Here is the code:
import torch import torchvision import torchlens as tl
model = torchvision.models.alexnet(pretrained=True) x = torch.rand(1, 3, 224, 224) model_history = tl.log_forward_pass(model, x, vis_opt='unrolled', save_function_args=True) layer_list = model_history.layer_list print(layer_list[-1]) print(model_history)