Skip to content
Advertisement

Tag: pytorch

why my model does not learn? Same on every epoch (Pytorch)

Output 0 – training loss: 0.0837 | test loss: 0.0806 100 – training loss: 0.0433 | test loss: 0.0431 200 – training loss: 0.0426 | test loss: 0.0425 300 – training loss: 0.042 | test loss: 0.0419 400 – training loss: 0.0414 | test loss: 0.0414 500 – training loss: 0.0408 | test loss: 0.0408 600 – training loss: 0.0403

Reshape original X from LSTM with predictions

I have a tensor with my LSTM inputs X (in PyTorch) as well as the matching predictions Y_hat I want to add the Y_hat as a column to the original X. The problem is that LSTM a sliding window with seq_length. In case seq. length is 3 and I have 6 variables in X, and 2 variables in Y_hat, I

Imported package searches for modules in my code

Can someone explain me what is going on here and how to prevent this? I have a main.py with the following code: I outsourced some functions into a module named utils.py: When I run this I get the following output: So it seems like the torch package I imported has also a utils resource (package) and searches for a module

How do I create a model from a state dict?

I am trying to load a checkpoint pth file from the faster_rcnn_resnet101 model which is not currently in the PyTorch model zoo. This causes PyTorch to throw a KeyError saying that I the layers in the state dict does not match the model architecture of faster_rcnn_fpn_resnet50 that I’ve loaded from the model zoo. Note: I tried posting the architecture of

`torch.gather` without unbroadcasting

I have some batched input x of shape [batch, time, feature], and some batched indices i of shape [batch, new_time] which I want to gather into the time dim of x. As output of this operation I want a tensor y of shape [batch, new_time, feature] with values like this: In Tensorflow, I can accomplish this by using the batch_dims:

Advertisement