Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
11 views

Question about the Mixture of Experts Layer

I came across the Mixture of Experts (MeE) layer from this paper I've read the paper and some threads, but I didn't understand how it really works. Here is what I understood: The gating network is ...
0
votes
1answer
14 views

Dealing with input images of different shapes in PyTorch

I've started to work with a leaf classification dataset on Kaggle. All input images have different rectangular shapes. I want to transform the input into squares of a fixed size (say, 224x224) with a ...
1
vote
0answers
21 views

How to choose the suitable Neural Network Architecture for Regression Tasks

I'm working on a project where I want to predict the Vehicle Position from the Vehicle Data like speed, acceleration, etc. The data that I have comes also with a timestamp for each sample (I mean that ...
1
vote
0answers
21 views

Pytorch lstm model very high loss in eval mode against train mode

I am using a Siamese network with a 2-layer lstm encoder and dropout=0.5 to classify string similarity. For each batch, I am randomly generating similar and ...
0
votes
1answer
23 views

PyTorch CNN network outputs homogeneous results

I am a beginner at data science and I got a project where I want to do nlp via a convolutional neural network in PyTorch. The problem is that regardless of what comes out of the convolutional layers, ...
0
votes
0answers
9 views

play session from ratings dataset in Movie20 M

I need to extract listening sessions from the ratings dataset which has the columns cols = [userId movieId rating timestamp] timestamp is just a number for eg 1112486027 listening sessions are ...
0
votes
0answers
31 views

Multi Class Text Classification

I am new in deep learning and I am trying to build a classification module which can classify text to one of 9 classes and then use the result of the classification to classify them to another set of ...
1
vote
0answers
18 views

Pytorch testing/validation accuracy over 100%

So I was training my CNN for some hours when it reached 99% accuracy (which was a little bit too good, I thought). But then it didn´t stop and it went higher than 100%. So I thought, that must be ...
0
votes
0answers
16 views

Beating Roulette with Neural Networks, YoloV3, and PyTorch

Background: I am in my last semester of electrical engineering, and I am working on my senior design project. The senior design project is a two-semester design project in which students outline, or ...
1
vote
0answers
13 views

High-dimensional indexing in PyTorch

I would like to grab tensor v1's third dim according to indices in tensor indices. I tried ...
1
vote
0answers
32 views

Would writing a decision tree algorithm in Pytorch or Tensorflow be faster than with Numpy?

Since these libraries can turn CPU arrays into GPU tensors, could you parallelize (and therefore accelerate) the calculations for a decision tree? I am considering making a decision tree class written ...
1
vote
0answers
14 views

Object coordinate detection with capsNet

Where can I find the implementation of object coordinate extraction with capsule networks in keras or pytorch?
0
votes
0answers
4 views

Training EfficientNet always throws CUDA exhausted error

I have been trying a hands on the EfficientNet-B6 architecture but evertime I try to train the same, It simply throws up CUDA resource exhausted error. I have been training it on 16GB Tesla P100
0
votes
1answer
107 views

Autoencoder: using cosine distance as loss function

I'm trying to train an autoencoder (in PyTorch) to reconstruct gene profiles. At the moment I'm using the Mean Squared Error (MSE) loss for training: the model is not overfitting and both the training ...
0
votes
0answers
3 views

RNN batch outputs

Suppose, we have a set of variable length sequences. First: apply rnn unit to each sample and save outputs. Second: pad each sequence up to max_length with zeros at beginning. Apply same rnn unit to ...
1
vote
1answer
22 views

How to compare a sentence with a paragraph and get its probability in terms of correctness?

This is my first post on stackoverflow network and I am dealing with a machine learning. Lets say I have a paragraph describing a rabbit and tortoise story. The story concludes that tortoise is a ...
0
votes
0answers
15 views

Pytorch Implementing Simple Attention using Dummy data

Hi I am trying to implement simple/General attention in Pytorch , So far the model seems to working , but what i am intersted in doing is getting the attention weights , so that i can visualize it . ...
0
votes
1answer
57 views

How does the forward method get called in this pyTorch conv net?

In this example network from pyTorch tutorial ...
0
votes
0answers
9 views

Are there any other recommended optimizers for word2vec/glove than Adagrad and SparseAdam?

adagrad and sparseAdam work great for sparse training because there’s separate sums for each of the parameters. Are there any other recommended optimizers for embedding training?
0
votes
0answers
13 views

What transforms do we need to apply to masks of images in segmentation tasks

I am trying a semantic segmentation task for multi-class segmentation. I am wondering what transforms are applied to both images and masks in it. Following are my transforms- ...
0
votes
1answer
24 views

Layer shape computation in convolutional neural net (pyTorch)

How can you know the expected input size (image input size (tensor size)), for example for this network (cf. pyTorch tutorial example ): ...
0
votes
0answers
21 views

PyTorch order of dimensions for NN-layer weights

I'm following the PyTorch beginner tutorial on neural networks, and can't understand the dimension orderings. From what I've found on the internet, the order of dimensions for a data tensor in PyTorch ...
1
vote
0answers
37 views

PyTorch neural network parameters and tensor shapes

I am following this tutorial: https://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html it's quite nicely done, however I do not understand/see where you can know the expected image ...
0
votes
0answers
22 views

processing sequence of sequences in PyTorch

I try to deal with some special sequences via recurrent modules and I have faced some non-trivial things: Sequences are not in same length. I have sequence of sequences, and my idea is to encode ...
0
votes
1answer
110 views

Multichannel numpy array to PIL image

I have a 4 channel Numpy image that needs to be converted to PIL image in order implement torchvision transformations on image. But when I try to do this using ...
2
votes
0answers
45 views

Tensorboard with pytorch dont display a graph

I am trying to visualize a model I created using Tensorboard with Pytorch but when running tensorboard and going to the graph tab nothing is shown, im adding my code for reference, also im adding a ...
1
vote
0answers
32 views

How does a Faster R-CNN gets trained and how does the Region Proposal Network fits into that?

so a Faster R-CNN consists of 3 parts: -the Base CNN -the Region Proposal Network with RoIpooling -and the classification CNN at the end So I asked myself if all these three Networks are trained ...
0
votes
0answers
44 views

pytorch problem gradient calculation

I create a neuron. I'm having a problem with recounting gradients. The problem is that I scalarly multiply 2 tensors u @ v and normalize one of them. It is ...
0
votes
0answers
10 views

I have a question about the structure of Faster R-CNNs

So hi, I need some help to understand the whole structure of the Faster R-CNNs. Further i will list the steps of the structur with questions between them: Image -> CNN -> (is the output ONE or ...
0
votes
0answers
16 views

Framing Multiple Parallel Series problem for LSTM

I'm dealing with a multiple parallel time series problem (see here) and I have an issue regarding the non-constant number of sample per timestamp (not timestep!) My problem is the following: I have ...
0
votes
0answers
37 views

Pytorch Implementation for ResNet Based UNet

I want to implement a ResNet based UNet for segmentation (without pre-training). I have referred to this implementation using Keras but my project has been implemented using PyTorch that I am not sure ...
0
votes
0answers
24 views

inverse unbind in pytorch

I have a tensor [128, 12, 3, 8, 8]. Using torch.cat(inputs.unbind()), I do ...
0
votes
0answers
11 views

Selfie image embeddings

https://arxiv.org/pdf/1906.02940.pdf I have read an article and want to implement an embedding algorithm. My problem is that I do not fully understand how the classifier is built in the decoder. More ...
-1
votes
1answer
27 views

Inputting Data for Machine Learning in PyTorch

I have scoured the internet and documentation, but have not yet been able to find a simple explanation of how to load data and/or simply type data into pytorch. I am just learning this library, and I ...
3
votes
0answers
95 views

Why embedding or rnn/lstm can not handle variable length sequence?

Pytorch embedding or lstm (I don't know about other dnn libraries) can not handle variable-length sequence by default. I am seeing various hacks to handle variable length. But my question is, why this ...
2
votes
0answers
13 views

hidden state of each sequence of mini-batch

I am new to Pytorch and trying to implement a lstm character level seq2seq model. What I am trying to do is: Each sequence is a list of the characters of a particular word and several words will ...
0
votes
0answers
18 views

How to add layers of one model to another model in Pytorch?

Like in Keras we can add layers of one model to another model using the following commands - ...
3
votes
1answer
81 views

Why is training and validation loss steadily rising (eventually to NaN) in this CNN of mine?

Dear ML and data scientists: I have 4 layers of gray scale images for every single biological specimen in my dataset. I am trying to train a 4-convolution CNN (see pytorch architecture below) to ...
1
vote
1answer
28 views

Guidelines to debug REINFORCE-type algorithms?

I implemented a self-critical policy gradient (as described here), for text summarization. However, after training, the results are not as high as expected (actually lower than without RL...). I'm ...
0
votes
0answers
111 views

How to convert Keras h5 to PyTorch pth format?

I have trained a feature extractor in Keras and saved the weights as a h5 file. Now I want to load the same weights into the same model created and initialized in PyTorch for performance comparisons. ...
1
vote
0answers
41 views

Can I use scipy.optimize module with PyTorch?

I need to use scipy.optimize module after encoding some data with pytorch. However, scipy.optimize does not take torch.tensor as its input. How can I use scipy.optimize module with data with gradient ...
0
votes
0answers
23 views

Converting a Keras model to PyTorch

I have a Keras h5 file that I want to load into the same model but this one is created using PyTorch. Is ONXX a viable intermediary option? What else can I use?
0
votes
0answers
19 views

Why might an LSTM not be able to model a series with offset

I've trained an LSTM network in Pytorch on a toy case and it can accurately model a stationary(ish) time series. I then add a slight offset to the target series and the network can add the bias but is ...
0
votes
1answer
43 views

Why would Pytorch be non-deterministic for batch only?

I am training a LSTM network on CPU and can achieve deterministic results when not using a dataloader. But when I used Pytorchs dataloader I achieve non-deterministic training error results, despite ...
1
vote
0answers
12 views

What is the correct formatting of the input tensor for multi-variate LSTM on Pytorch?

I am working on a LSTM to predict a financial time series using 10 other financial time series. The 10 financial time series form my training dataset. Several examples I have seen for univariate ...
0
votes
1answer
64 views

Which algorithm can be used to reduce dimension of multiple time series?

In my dataset, a data point is essentially a Time series of 6 feature over a year per month so in all, it results in 6*12=72 features. I need to find class outliers so I perform dimensionality ...
1
vote
0answers
22 views

Train CNN-RNN network for multi label video classification with sliding window technique

I’m implementing a model in which a CNN model is used to extract feature sequences from videos , and RNN is used to analyze the generated feature sequences, and output a multi label classification ...
0
votes
1answer
27 views

What is the use of @ between two matrices

I was looking into a repo, where I came across this snippet of code: priors = x[None, :, :, None, :] @ self.route_weights[:, None, :, :, :] It basically tried to ...
0
votes
1answer
21 views

Predicting a numeric variable from many numeric variables, how to choose a proper structure?

I need to estimate the value of a one numeric variable from the values 8 numeric variables y = f(x_1, ..., x_8). I have an historical dataset where I can relate ...