We changed our privacy policy. Read more.

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
0answers
3 views

PyTorch defaulting storage to float64 (double) even if setting default type manually in vs code vs jupyter notebook environment

I've been getting a strange error while trying to run a working trainer as part of my application that involves pytorch and it's tensor class which is confusing me. It relates to precision. In my ...
1
vote
1answer
26 views

Trained model performs worse on the whole dataset

I used pytorch as the training framework and the official pytorch imagenet example to train the image classification model with my custom dataset. My custom dataset has 2 different label (good and bad)...
0
votes
0answers
12 views

Why does my training explode?

I'm trying to implement A new lower and upper bound estimation model using gradient descend training method for wind speed interval prediction For simplicity purposes, I've changed the training data. ...
0
votes
0answers
9 views

NeMo Conformer-CTC Predicts Same Word Repeatedly When Fine-Tuning

I'm using the NeMo Conformer-CTC small on the LibriSpeech dataset (the clean subset, around 29K inputs, using 90% for training and 10% for testing). I use Pytorch Lightning. When I try to train, the ...
0
votes
1answer
15 views

Is it possible to apply pooling across the channel dimension of the input tensor?

I have an input tensor of the shape (32, 256, 256, 256). In this tensor shape, 32 is the batch size. second 256 is the number of channels in the given image of size 256 X 256. I want to do pooling in ...
0
votes
0answers
19 views

Can Adagrad or Adam be used in loss function with l1-norm regularization?

there is one question for me. I want to know that how Adam or Adagrad treat l1-norm regularization in loss-function? (e.g. Lasso) I know that l1-norm is not differentiable function at zero but we can ...
1
vote
0answers
19 views

Classifying data that seems non linear

The data I am using specifies a series Cartesian coordinates, and velocities and there will be solutions that are fairly closely plotted for all of these... however it also utilizes rotations and the ...
0
votes
0answers
10 views

change the value of the minimum of each row which satisfy condition

I have a tensor in which each row contains a value between 0 and 1. I am doing a multi-label classification and I change each value which is greater than 0.5 to 1 and else 0. (tensor > 0.5) The ...
0
votes
0answers
8 views

Backward LSTM in Pytorch

I'm in the process of rebuilding a network using PyTorch. The Keras implementation uses a LSTM module with the parameter go_backwards=true: ...
0
votes
0answers
18 views

Generating unique points with an auto-encoder

I have been working on some research using a type of auto-encoder to generate new points with specific desirable properties. I trained my network and successfully generated some points, but when I ...
1
vote
0answers
40 views

Best way to find nearest neighbor distance for large datasets

I am a grad student doing research using generative machine learning with pytorch, and I have generated a set of points. I would like to check how similar these new points are to the points I used in ...
0
votes
1answer
21 views

Taking the squared Euclidean distance for kNN classification of images

A problem I'm working on states: Computes the squared Euclidean distance between each element of the training set and each element of the test set. Images should be flattened and treated as vectors. ...
0
votes
1answer
23 views

Concatenate two tensors of different shape

I have two tensors: ...
0
votes
1answer
19 views

can I use the pre trained model with different input channel size?

The pretrained model accepts the input shape like this; [batch_Size, Channels, Depth, Height, Width] [32, 3, 16, 224,224] I want to give it; ...
0
votes
0answers
13 views

pytorch lightning produces no checkpoint when learning rate fine tuning ison

My problem is concerning with using the automatic learning rate finder of pytorch lightning. In case I use this feature there isn't any checkpoint output produced at any time during the training of ...
0
votes
0answers
9 views

How can I resume my saved model for training on next epochs?

This is the model which I saved, I have trained the model for 3 epochs, I am wanting to train it for next finite epochs, can any one tell me how can I resume the training process for next 3-finite ...
0
votes
0answers
17 views

PyTorch resnet bad tensor dimensions

I'm trying to setup a face detection/recognition pipeline using Pytorch. I load the image using opencv image = cv2.imread('...') I load the ...
0
votes
0answers
15 views

Training and validation accuracy stagnating after a few epochs for text embeddings

I have text embeddings (768 dimensional vectors). I tried to build a feed forward neural network on classify the text into two classes. The network I used. ...
0
votes
1answer
32 views

How does using another agents action choice impact the efficacy of learning with Deep Reinforcement Learning

I am doing a project where I have multiple soft actor-critic sub-agents learning at the same time in an environment using shared experiences. Each sub-agent selects an action using their own policy, ...
0
votes
1answer
19 views

Invalid shape (4, 460, 513) for image data

I am using read_image to read the image. ...
0
votes
0answers
23 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 ...
0
votes
1answer
36 views
0
votes
1answer
24 views

How can I load the custom data in the data loader (pytorch)

Note: I have extracted the frame for all videos and save it in the folder with the same name of video train_data, class, video ---> These are folders img --> these are jpg files, so each class ...
0
votes
0answers
13 views

How to modify this training function in order to print the aggregation of models

I have 3 VGG: VGGA, VGGB and VGG*, trained with the following training function: ...
0
votes
1answer
20 views

How to decide the padding size and stride size in CNN

In CNN in 2d, what situation is the size of the padding and stride changed in? So far, I could make sense of the basic concepts with padding and stride. Padding and stride can be used to adjust the ...
1
vote
1answer
11 views

What is the logic behind recommended normalization parameters in PyTorch?

On the PyTorch documentation for torchvision.models, it is states that images have to be loaded in a range of [0,1] and then normalized using ...
0
votes
1answer
19 views

Batch normalization for multiple datasets?

I am working on a task of generating synthetic data to help the training of my model. This means that the training is performed on synthetic + real data, and tested on real data. I was told that batch ...
0
votes
0answers
26 views

Can the 'Rainbow Algorithm' be scaled up and sped up?

What's the proper way to train the algorithm with bigger batches or otherwise speed it up? The 'Rainbow Algorithm' is a Deep Q, Reinforcement Learning algorithm with two neural networks that I would ...
0
votes
0answers
34 views

PyTorch backwards() call on loss function

Can someone confirm that a call to loss.backward() given loss defined with nn.MSELoss() if called in a loop like this: ...
2
votes
0answers
21 views

When to stop the final model training?

Let's say I'm participating in a Kaggle image recognition competition. Firstly, I create a train/validation split and find the good hyperparameters for my model. Here the stopping criterion is when ...
0
votes
0answers
15 views

Systematically finding a CNN architecture?

I am trying to train a classifier from 25k images and 7k classes. Seems like my model overfits just after 3 epochs. I have tried to reduce the model complexity and increase the weight decay but still, ...
1
vote
1answer
41 views

Is there a general rule for how many layers a NN should be based on the number of inputs?

I have a neural network that takes 1935 inputs, so I'm wondering if there is a general rule for how many layers the network should be. Should the number of neurons be descending by a certain amount?
0
votes
0answers
21 views

LSTM decoder with 2d's input

I am developing a CNN-LSTM autoencoder in pytorch to predict time sequences. The CNN input is a RGB image: RGB image => tensor[Batch size= 4, channel = 3,width= 256, height=256] and the output is ...
0
votes
0answers
25 views

Implementing class weighting in Faster RCNN

I have a dataset (around 45,000 screenshots) of UI elements (UI trees containing element types and bounding boxes) and associated screenshots: The dataset is highly imbalanced with the button element ...
0
votes
1answer
60 views

Cuda for PyTorch and Cuda for Tensorflow

I want to install PyTorch and for that I visited PyTorch official website, and they give me a command to install it with Cuda: ...
0
votes
0answers
114 views

global average pooling in PyTorch: torch.nn.AvgPool1d vs torch.mean

To implement global average pooling in a PyTorch neural network model, which one is better and why: to use torch.nn.AvgPool1d() and set the ...
1
vote
0answers
14 views

What is num_groups in GroupNorm and how to choose it

I found that batch_norm can cause problems with small batch sizes and that GroupNorm is a good alternative. Now, GroupNorm requires two parameters, the num_group and the num_channels. How can I choose ...
0
votes
1answer
28 views

How do the linear + softmax layers give out word probabilities in Transformer network?

I am trying to implement a transformer network from scratch in pytorch to understand it. I am using The illustrated transformer for guidance. The part where I am stuck is about how do we go from the ...
0
votes
0answers
5 views

Custom PyTorch dataset class for a dataset of unknown size

I need a custom PyTorch Dataset that generates training images as following. Get an image from a training set. Choose a random location to crop a 352x352 segment of an image. Compute the usefulness ...
0
votes
0answers
12 views

How do I prevent infinite variances/standard deviations in my variational autoencoder?

I am working on a project with a variational autoencoder (VAE). The problem I have is that the encoder part of VAE is producing large log variances, which leads to even larger standard deviations, ...
4
votes
1answer
39 views

Can you use fully convolutional networks for binary classification?

I know that fully convolutional networks can be used for image segmentation and similar but I wondered if you could also apply them to simple image classification tasks. And if so, what is the proper ...
0
votes
1answer
22 views

Hook up PyTorch U-Net model to video

I built a U-Net model in PyTorch that is trained on medical images to detect polyps. The purpose of the model is to do semantic segmentation, so it must predict the location + class of polyps. Now I ...
0
votes
0answers
21 views

How can I get dark, median-brightness and bright distribution histograms from an image?

I'm trying to replicate an augmentation technique used in this paper. This is how they explain the procedure: [...] the augmentation technique was used to adjust the histogram because the intensity ...
2
votes
1answer
52 views

Implementing computational graph and autograd for tensor and matrix

I am trying to implement a very simple deep learning framework like PyTorch in order to get a better understanding of computational graphs and automatic differentiation. I implemented an automatic ...
0
votes
0answers
10 views

How to prepare data for TpyTorch's 3d attn_mask argument in MultiHeadAttention

I'm currently trying to implement an Encoder-Decoder architecture for text summarization based on Transformers. Thus I need ti apply MultiHeadAttention on the Decoder site of the model. Since I want ...
0
votes
0answers
20 views

PyTorch fcn_resnet50: Inconsistent segmentation performance in training and evaluation

Although fcn_resnet50 is shown to perform well in pytorch examples and tutorials, the performance on my end tells a different story in training. fcn_resnet50 segments relatively poorly in training, ...
0
votes
1answer
30 views

How to handle imbalanced NLP text data set e.g. some classes only have 2 records

I am working on a dataset with around 2000 records. Around 80% records have their the categorical labels. There are around 200 categories, some categories got more than 20 records; whereas others only ...
2
votes
1answer
72 views

Using Subsequent Mask in Transformer Leads to NaN Outputs

I am trying to implement an autoregressive transformer model similar to the paper attention is all you need. From what I have understood, in order to replicate the architecture fully, I need to give ...
0
votes
0answers
19 views

Pytorch DataLoader returns iterable , how and when to convert into a Tensor for Model Training

I have coded up two DataSet classes (one map-style and one iterator-style) to be used with DataLoader (either one is okay, but I just wanted to experiment and learn myself) on TEXT data. The data + ...

1
2 3 4 5
10