Skip to main content

Questions tagged [pytorch]

Pytorch is an open source library for Tensors and Dynamic neural networks in Python with strong GPU acceleration. For details, see https://pytorch.org.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Efficiently Implement a Data Transformation || Pytorch || coding advice

I have created the following class and function to create a 'custom' dataset. The use case was to sample every nth image from a data set to reduce the size of the data set while still maintaining ...
James's user avatar
  • 11
-1 votes
0 answers
8 views

Assistance Required with Python Project Setup

I am currently focusing on enhancing my skills in deep learning and have recently downloaded a project from GitHub to work on. Unfortunately, I am experiencing issues with getting the project to run ...
dreamv's user avatar
  • 1
1 vote
1 answer
28 views

Unordered Set Classification Problem

In my setup I have one feature which is a sparse list representing categories. For example, let's say that we have M categories in the interval ...
dpalma's user avatar
  • 111
1 vote
0 answers
10 views

Transfer Learning - GoogLeNet - Training Times || Loss not converging || Pytorch

Hi Community and thanks in advance for the help. I am working on transfer learning - specifically GoogLeNet model with the Food101 Dataset. Code is below. I think everything is in order from data ...
James's user avatar
  • 11
0 votes
0 answers
26 views

Extremely Imbalanced and Gapped Dataset in Regression Problem

Currently I am working with a biological dataset with a range of 0-to-1 to do a multi-task regression with Deep Learning. However, this dataset has an empty gap in the range 0 to 0.2 (however there ...
Abdullah Faqih's user avatar
0 votes
0 answers
10 views

Problem when merge two probability distribution [Pointer Network]

I'm trying to re-implement Pointer Gen Net from this paper. Ya but you don't really need to read the paper. To sum up briefly, I have a vector probability distribution over vocabulary called p_vocab. ...
jupyter's user avatar
  • 101
1 vote
1 answer
39 views

Does using different optimizer change the loss landscape

I plot the landscape using this code, and I notice the landscape shape has changed a lot. My understanding is that the optimizer does not change the loss landscape. But now I'm confused if its just ...
user836026's user avatar
1 vote
0 answers
19 views

word2vec predicts the same word for all inputs

i build word2vec network with 2 linear layers from pytorch. for every word as an input i consistently train model to predict words before and after, for example: i was visiting my grandma's house, for ...
Тима 's user avatar
0 votes
0 answers
50 views

How to properly prune a YOLOv8 model

I was trying to apply pruning to a YOLOv8 detection model. Following is my code and it runs successfully. I see the saved pruned model as well. My YOLOv8 model has 22 layers (an example list of layers ...
Mary H's user avatar
  • 1
0 votes
1 answer
27 views

Why torch activation functions contains parameters?

What is the purpose of the weights?
Тима 's user avatar
0 votes
1 answer
14 views

Understanding batching in pytorch models

I have following model which forms one of the step in my overall model pipeline: ...
Mahesha999's user avatar
0 votes
1 answer
17 views

Pytorch backward error

Here I overcame a problem about backward, below is a simple example written by python code. the print information is that This really confused me as self.weights is used as a important part in my ...
Ecthelion's user avatar
0 votes
1 answer
20 views

Applying dropout effectively in CNN

I am fairly new to deep learning and machine learning in general and have been trying to teach myself. I’m interested in understanding when and how to effectively use dropout in a CNN. While ...
Nile's user avatar
  • 3
0 votes
0 answers
5 views

Adding sliding window dimension to data causes error: "Expected 3D or 4D (batch mode) tensor ..."

I wrote a pytorch data loader which used to return data of shape (4,1,192,320) representing the 4 samples of single channel image, each of size ...
Mahesha999's user avatar
0 votes
0 answers
19 views

Multiclass PyTorch neural net is stuck predicting 1 class, even with "simple" dataset

I'm trying to predict a class of some data, and am struggling. So, to debug I created a simple test dataset, yet I am having the same issues. I've tried adding weighting, and lastly adding a column ...
Russ's user avatar
  • 1
0 votes
0 answers
16 views

Training the neural network does not give the expected result

I'm trying to create a pytorch neural network capable of recognizing peaks in 2D graphs. Previously, I was able to get a result close to what I wanted, but it was not ideal and did not give a ...
AlterEGO's user avatar
0 votes
0 answers
21 views

ML Methods For Modelling Latent Variables

I have some time series predictor variables, $\{\mathbf{X}_t\} = \{\mathbf{X}_0, \ldots, \mathbf{X}_n\}$, and some other time series data $\{\mathbf{Z}_t\} = \{\mathbf{Z}_0, \ldots, \mathbf{Z}_n\}$. ...
baked goods's user avatar
0 votes
0 answers
12 views

Why is my 3D CNN stuck at constant accuracy?

I am writing a CNN for binary classification MedMNIST data: https://medmnist.com/, specifically the Lung Nodule 3D dataset (N=1633 and 7:1:2). Currently, my model is not training at all; it is either ...
Matthew H's user avatar
0 votes
0 answers
22 views

Validation loss and training loss is not increasing in pytorch

validation loss and training loss is not increasing. I try to imply l2 regularization in form of weight decay as 0.05 but I have removed and tried maybe that could be the reason. I have even removed ...
beschichtung346's user avatar
1 vote
0 answers
30 views

Gaussian process regression not working in GPytorch and Scikit-learn, can't find suitable hyperparameters

This is a MWE of my problem, basically I want to find out the map between qin and qout using a Gaussian process and with that ...
Hans's user avatar
  • 111
0 votes
0 answers
8 views

Add a custom loss in a public github repository on distillation

I’m trying to implement a custom loss in a public repository regarding knowledge distillation. The link to the repository is the following: " https://github.com/DefangChen/SimKD " The main ...
PiEmmeC's user avatar
1 vote
1 answer
302 views

FutureWarning in pandas when working with Series

I'm coding a custom (but simple) dataset for training an MLP with PyTorch. Basically, my data are numeric vectors of two classes so the whole dataset is a ...
leapofFaith's user avatar
0 votes
0 answers
56 views

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:3! in DPOTrainer with ec2 G5 12X Large

...
Sandun Tharaka's user avatar
0 votes
0 answers
11 views

CNN matrix shape issue when adding new convolutional layer

I have been adding more & more convolutional layers to my model to see how they effect model size & accuracy. It was all going fine until I added my 6th convolutional layer. ...
DrBwts's user avatar
  • 101
1 vote
0 answers
49 views

Negative MNIST - Trying to understand what's going on here

I'm new to machine learning and pytorch and any insight would be greatly appreciated. I've been playing around with the MNIST number recognition dataset and thought it would be interesting to train ...
Sloth Man's user avatar
  • 111
0 votes
0 answers
31 views

Semantic segmentation sometimes give bad result

I'm training Unet+MobileNetV3 for semantic segmentation objects on real photos using custom dataset and get strange results. I have already accumulated pretty big dataset and constantly improve it by ...
Vladislav D's user avatar
0 votes
0 answers
9 views

Seeking ML Model Recommendations for Enhancing OCR on Corrupted Text Images

I am working on a project where I need to perform Optical Character Recognition (OCR) on text-based images. However, these images are corrupted in various ways (e.g., blurred, distorted, low ...
Nurbek Ss's user avatar
0 votes
0 answers
45 views

Safetensors are slower than torch.load. Why?

Lately, I have been testing safetensors. It claims that the safetensors are faster and safer than pickle. So I did my own comparison with the code below: ...
mark's user avatar
  • 103
1 vote
0 answers
26 views

How to apply this schematic of a CNN?

I'm trying to apply a model from a paper to my problem, however I get very poor results (R² = 0.1 for regression). I think I don't understand the schematic drawing of the CNN used in the paper. Could ...
YPOC's user avatar
  • 111
1 vote
1 answer
22 views

Extraction of name from phonetic transcription

I have a use case where I want to extract the name from the phonetic transcription. For example if the phonetic transcription is - “m a j n e j m ɪ z s ʌ m i ɹ z o w ʃ i”, the output should be the ...
Sameer Joshi's user avatar
0 votes
0 answers
37 views

reverse summary matching

How can we develop a model to assess the relationship between a summary and a text, enabling it to determine their coherence but in reverse? Also, how to make an inference We have list of texts (2000) ...
whoopdedoo's user avatar
-1 votes
1 answer
51 views

Why is my NN model's prediciton for y= sinc(x) function showing symmetric?

...
RimaMonica's user avatar
0 votes
1 answer
20 views

How to get the closest samples to time series dataset?

I have a deep learning time series classification model. I want to understand if the model failed to classify, due to missing or incorrupt training inputs. For simplicity let's say we have a training ...
user3668129's user avatar
1 vote
1 answer
33 views

How to add a new item in the embeddings vocabulary?

Imagine you have trained a model containing an Embedding layer. Your model performs well and you're happy with your embedding. Then, suddenly, you want to add a new item in your vocabulary. In other ...
MarcoM's user avatar
  • 111
0 votes
0 answers
17 views

Custom loss function for collinearity of 3 embeddings

I am trying to implement a loss function that takes as input 3 embeddings and output a value that is proportional to the collinearity of the embeddings. This is to shape the latent space of a ...
vlc's user avatar
  • 1
0 votes
0 answers
15 views

How to detect abnormal fetal head size with image classification?

I'm writing Python code to predict fetal head circumference 10mm range using classification. The model will train to classify a fetal head image into a range (e.g., 50–60 mm) representing its ...
NiStack's user avatar
0 votes
1 answer
25 views

Performance difference between two equivalent ML codes

Using the two Python libraries GPyTorch and scikit-learn to perform Gaussian Process Regression (GPR) for a machine learning task, I have encountered a problem I failed to solve during the last days. ...
C_Swann22's user avatar
  • 111
0 votes
0 answers
10 views

Help with a MaNet finetuning (binary semantic segmentation task)

Introduction: I am currently working on a computer vision problem, I have satellite images and I have to detect a particular archeological structure (Tell). I have access to the previously made ...
Alessandro Pistola's user avatar
1 vote
2 answers
30 views

Image segmentations vs image detection

If I need to detect on an image some objects and we are only interested in counting them, between image segmentation and object detection which one would you think would yield best results in terms of ...
Dinu Mihai's user avatar
0 votes
0 answers
9 views

Is it fair to say that Hausdorff Distance (HD) focuses on low level details while dice score (DSC) high level

I wonder if its make sense to say that Hausdorff Distance (HD) measures low-level details while dice score (DSC) focuses on high levels. If you could cite a paper, I would appreciate it.
user836026's user avatar
0 votes
0 answers
25 views

CNN segmentation models: class weights specification on IoU metric

I am building a MANet model using pytorch lightning. For getting the model I use the library segmentation models. As my objective is to do binary semantic segmentation, during the test phase I ...
Alessandro Pistola's user avatar
0 votes
0 answers
23 views

why does my multi-modal model can not learn anything?

I have a multi-modal model. I want to train it using the Pytorch Framework. I have a balanced dataset. I have approximately 150 samples for each client. (I had preprocessed my text data.) when I train ...
arcane_data's user avatar
0 votes
0 answers
9 views

Relationship among different classifiers of a model in multiclass problems

Suppose we are fitting a LogisticRegression model with scikit-learn, or the same model with pytorch. In multiclass problems, the strategy OneVsRest will fit a different classifier for each of the ...
CasellaJr's user avatar
  • 229
0 votes
1 answer
249 views

Transformers Trainer: "RuntimeError: module must have its parameters ... on device cuda:6 (device_ids[0]) but found one of them on device: cuda:0"

I ask this since I could not fix it with the help of: Stack Overflow RuntimeError: module must have its parameters and buffers on device cuda:1 (device_ids[0]) but found one of them on device: cuda:2 ...
questionto42's user avatar
1 vote
1 answer
64 views

"model.to('cuda:6')" becomes (nvidia-smi) GPU 4, same with any other "cuda:MY_GPU", only "cuda:0" becomes GPU 0. How do I get rid of this mapping?

Strange mapping: example In the following example, the first column is chosen in the code, second column is the one that does the work instead: 0:0 1234 MiB 1:2 1234 MiB 2:7 1234 MiB 3:5 2341 MiB 4:1 ...
questionto42's user avatar
0 votes
0 answers
25 views

Why does Mistral model or in general Large language models have very low percentage of trainable parameters compared to total number of parameters of?

I am using the below function to print the trainable parameters. I am getting this output: trainable params: 262410240 || all params: 7241732096 || trainable%: 3.6235839233122604 ...
SRIVATSA KULKARNI's user avatar
0 votes
0 answers
11 views

Why do all the resulting curves from my function combining N-many random ReLUs look like quadratics?

I've written a function that generates a sum of N-many RelU functions, with random slopes and activation points. I was expecting these resulting functions to be arbitrary, random curves, but for some ...
Marco Acea's user avatar
1 vote
1 answer
91 views

Is this the correct way to calculate word embeddings using Roberta?

I'm trying to write a program that using Roberta to calculate word embeddings: ...
user avatar
0 votes
1 answer
35 views

How to prevent update a pretrained model if a model is optimized with backpropagation in Pytorch?

I use Pytorch exclusively to develop my model, and these are components in my model and how it works: A generator An encoder: a pretrained, and should not updated. A loss function. Input is passed to ...
Jesse's user avatar
  • 101
0 votes
0 answers
26 views

Loss Function does not decrease when positivity constraint is added

I have tried coding up an autograd program in Pytorch to perform a reconstruction of an complex valued image. When I run the autograd normally, it produces a semi-accurate reconstruction of the image ...
yes's user avatar
  • 1

1
2 3 4 5
15