Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
742 views

Torchmetrics Binary Accuracy and Multiclass Accuracy don't match

in my program I have the problem that for a 2-class classification problem my multiclass accuracy and binary class accuracy don't match. I have generated a very small sample example where you can see ...
YumYum's user avatar
  • 3
0 votes
1 answer
134 views

How to implement a customized DataLoader that inherits pytorch's one?

I need to implement a customized DataLoader, that inherits from torch.data.utils.DataLoader. I have searched it for half hour, but there is no example or doc about this. What methods of it should I ...
EvilRoach's user avatar
  • 101
2 votes
1 answer
2k views

Input type (MPSFloatType) and weight type (torch.FloatTensor) should be the same

I am trying to run this notebook on Apple M1 (1st gen) running MacOS 12.4, libs freeze: ...
Deepkamal's user avatar
  • 121
0 votes
0 answers
14 views

What is the reason of this behavior of training loss in CONV auto-encoders?

I don't get Training Loss is steady up to the 7th epochs
Alessandro Mondin's user avatar
0 votes
0 answers
73 views

How can I reshape (16,) and (3,112,112) shape to the single (16,3,112,112)? See code below

This is my code; for img_loc in list(self.train_data)[idx]: images_set.append(self.load_ucf_image(img_loc)) print(images_set) And, this is its output ...
Tariq Hussain's user avatar
0 votes
1 answer
203 views

Torch tensor view and stride mechanics

I want my Mx2xN float tensor to become MxN complex tensor. In this minimal example I supply the the 10x2 matrix which should become the vector [0+10j,1+11j,2+12k,...] ...
Eric S's user avatar
  • 1
0 votes
1 answer
206 views

Why does my GPU immediately run out of memory when I try to run this code?

I am trying to write a neural network that will train on plays by Shakespeare and then write its own passages. I am using pytorch. For some reason, my GPU ...
Christoffer Corfield Aakre's user avatar
3 votes
1 answer
141 views

How to specify version for dependencies so that each one is compatible and stays within a size limit?

I am trying to deploy a web app to Heroku. The free tier is limited to 500 MB. I am using my resnet34 model as a .pkl file. I create model with it using the fastai ...
truth's user avatar
  • 280
1 vote
0 answers
338 views

Why does the learning rate influence whether i get a error from BCE or not? [closed]

When I use a learning rate higher than 0.001, I get this: Assertion `input_val >= zero && input_val <= one` failed. This means that the input I gave ...
SamuelS's user avatar
  • 11
2 votes
1 answer
2k views

how to implement squared hinge loss in pytorch

does anyone have any advice on how to implement this loss in order to use it with a convolutional neural network? Also, how should I encode the labels of my training data? We were using one hot ...
Giacomo Zema's user avatar
1 vote
0 answers
96 views

Write way to add samples to torch TabularDataset

I have a TabularDataset and i would like to add some examples to the dataset. ...
lads's user avatar
  • 423
5 votes
1 answer
7k views

Does torch.cat work with backpropagation?

I was wondering if it was okay to use torch.cat within my forward function. I am doing so because I want the first two columns of my input to skip the middle hidden layers and go directly to the final ...
jongu's user avatar
  • 53