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
2 votes
0 answers
639 views

Output size is too small for SpatialAveragePooling in Unet

Tried this to use Resnext as encoder in Unet from here, but keep getting RuntimeError: Given input size: (4320x4x4). Calculated output size: (4320x-6x-6). Output size is too small at /opt/conda/conda-...
Rocketq's user avatar
  • 143
3 votes
3 answers
17k views

How to use Cross Entropy loss in pytorch for binary prediction?

In the pytorch docs, it says for cross entropy loss: input has to be a Tensor of size (minibatch, C) Does this mean that for binary (0,1) prediction, the input must be converted into an (N,2) ...
AAC's user avatar
  • 469
2 votes
1 answer
524 views

Query on unstable loss curves for RNN

I’m currently building sequence models for forecasting, and have tried using RNNs, LSTMs, and GRUs. Something unusual I noticed was the highly unstable loss curves, where the loss sometimes goes back ...
Eugene Yan's user avatar
1 vote
1 answer
2k views

Is GEMM used in Tensorflow, Theano, Pytorch

I know that Caffe uses GEneral Matrix to Matrix Multiplication (GEMM) which is part of Basic Linear Algebra Subprograms (BLAS) library for performing convolution operations. Where a convolution is ...
Gaurav Srivastava's user avatar
5 votes
1 answer
9k views

Are view() in Pytorch and reshape() in Numpy similar?

Are view() in torch and reshape() in Numpy similar? view() is applied on torch tensors to ...
Kailash Ahirwar's user avatar
0 votes
1 answer
651 views

Basic DNN with highly imbalanced dataset -- network predicts same labels [closed]

I will try to explain my issue at a high level, and I hope I'd be able to get some better understanding of the ML behind it all. I am working with aggregated features extracted from audio files, so ...
manestay's user avatar
1 vote
0 answers
24 views

Convolutional Neural Network with feature inputs also directly connected to fullly connected layers

Imagine you are trying to classify movie reviews you have both the actual review and also some information about the movie. I pass the actual review through a few convolutional layers and some max ...
Tank's user avatar
  • 287
1 vote
0 answers
143 views

Inseting pretrained network to pytorch

I am new to deep learning as well as pytorch. I have got the following code (siamese network) working with pytorch: https://github.com/KrisG04/Siamese-using-PyTorch/blob/master/Siamese-networks-...
Priya Narayanan's user avatar
1 vote
1 answer
273 views

2D Pytorch tensor doesn't have independent random values

I've written some Python to create a pytorch tensor of random values, sampled from a Student's t distribution with 10 degrees of freedom: ...
J.G.'s user avatar
  • 153
2 votes
1 answer
2k views

Enable Mini-batch Processing on PyTorch Word Embeddings

I am new to PyTorch and trying to create word embeddings. I started with the example below and everything works fine and it completes relatively quickly. ...
Skiddles's user avatar
  • 978
67 votes
4 answers
151k views

What is the use of torch.no_grad in pytorch?

I am new to pytorch and started with this github code. I do not understand the comment in line 60-61 in the code ...
mausamsion's user avatar
  • 1,227
0 votes
0 answers
575 views

FastAI to PyTorch conversion

I have been taking the FastAI course. And if anyone else has taken this course they know that they use their own python library called fastai that is a wrapper for ...
conv3d's user avatar
  • 221
1 vote
4 answers
3k views

Sparse connections in feedforward network tensorflow or pytorch?

I want to create sparse feed-forward networks in Pytorch and Tensorflow, i.e., say each node is only connected to k number of neurons of the next layer where k is strictly less than the total number ...
Dave's user avatar
  • 11
2 votes
2 answers
679 views

Help me choose a Data Science book in Python [closed]

I've been a Data Scientist for a few years now, but I've only recently started to do most of my work in Python (boy, do I miss ggplot2! But ...
DeltaIV's user avatar
  • 399
2 votes
2 answers
3k views

Dropout Decreases Test and Train Accuracy in one layer LSTM in Pytorch

I have a one layer lstm with pytorch on Mnist data. I know that for one layer lstm dropout option for lstm in pytorch does not operate. So, I have added a drop out at the beginning of second layer ...
Hadi Gharibi's user avatar
1 vote
0 answers
540 views

Pytorch loss function for Levenshtein (edit) distance between letters in images

Is it possible to use the Levenshtein (edit) distance of two strings as the error function my model attempts to optimize? The inputs are images representing the letters in a text document. The output ...
Matthew Ciaramitaro's user avatar
1 vote
2 answers
1k views

Image segmentation training set labeling

I am new to pytorch and Deep learning. I am trying to do image segmentation. But , I am stuck at how to label training set images. Can anyone please help me ? This is one of my training image I ...
DukeLover's user avatar
  • 561
1 vote
1 answer
196 views

Forward and backward process in pyTorch

When I write a network, do I have to write the whole forward property in nn.Module.forward()? I mean if I do some operations outside the net, does grad correctly ...
Yang Jiao's user avatar
2 votes
1 answer
1k views

Perform several different torchvision.transforms on ImageFolder object

I am using pytorch to build DCGAN which i aim to train on custom dataset. I have already posted a question on training DCGAN on small dataset, and of course answer was data augmentation. But i have ...
Stefan Radonjic's user avatar
5 votes
1 answer
9k views

How/What to initialize the hidden states in RNN sequence-to-sequence models?

In an RNN sequence-to-sequence model, the encode input hidden states and the output's hidden states needs to be initialized before training. What values should we initialize them with? How should we ...
alvas's user avatar
  • 2,330
1 vote
1 answer
1k views

Resuming from checkpoint, accuracy drops for one cycle

I'm experiencing a weird issue when trying to finetune a model with PyTorch. I've adapted a script similar to imagenet.py training script from PyTorch repository. ...
Alon Burg's user avatar
  • 111
2 votes
2 answers
6k views

How to make output dimensions match input dimensions in CNN?

I have training samples of the following shape: (1000,2). These are numeric sequences, each of length = 1000, dimensions = 2. I need to build a Convolutional Neural Network to output Predictions/...
user4155621's user avatar
6 votes
0 answers
599 views

Adversarial Learning for Semantic Segmentation

I am incorporating Adversarial Training for Semantic Segmentation from Adversarial Learning for Semi-Supervised Semantic Segmentation. The idea is like this: The discriminator takes as input a ...
ethelion's user avatar
14 votes
2 answers
14k views

Strange behavior with Adam optimizer when training for too long

I'm trying to train a single perceptron (1000 input units, 1 output, no hidden layers) on 64 randomly generated data points. I'm using Pytorch using the Adam optimizer: ...
Bai Li's user avatar
  • 243
15 votes
1 answer
3k views

PyTorch vs. Tensorflow eager

Google recently included in tensorflow's nightly builds its Eager mode, an imperative API to access tensorflow computation capabilities. How do tensorflow eager compare to PyTorch? Some aspects that ...
noe's user avatar
  • 20.7k
5 votes
1 answer
6k 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
7 votes
2 answers
2k views

Any pytorch tools to monitor neural network's training?

Are there any tools to monitor network's training in PyTorch? I am looking for an equivalent to tensorboard in tensorflow.
Chati Denati's user avatar
1 vote
0 answers
467 views

Global average polling without fc layer, Vanishing gradient or other problem?

I have built this network with pytorch, it's basically a modification of VGG16, I add some layers and remove some. The output of the network are meant to be softmax scores for F.multilabel-soft-margin-...
Zhang Yu's user avatar
  • 113
10 votes
2 answers
14k views

What is the difference between Pytorch's DataParallel and DistributedDataParallel?

I am going through this imagenet example. And, in line 88, the module DistributedDataParallel is used. When I searched for the same in the docs, I haven’t found anything. However, I found the ...
Dawny33's user avatar
  • 8,156
13 votes
3 answers
2k views

An Artificial Neural Network (ANN) with an arbitrary number of inputs and outputs

I would like to use ANNs for my problem, but the issue is my inputs and outputs node numbers are not fixed. I did some google searches before asking my question and found that the RNN may help me with ...
Vadim's user avatar
  • 303
4 votes
1 answer
274 views

How to determine if a neural-network has a static computation graph?

I'm looking at implementing some neural networks from research papers. However, I'm concerned about which framework I should use, because I'm uncertain if the networks form static computation graphs (...
Seanny123's user avatar
  • 151
5 votes
2 answers
12k views

How to install pytorch in windows?

I was wondering, if there is any way to install pytorch in windows like the way we can install tensorflow. My machine is not supporting docker.
prisar's user avatar
  • 153
27 votes
1 answer
10k views

PyTorch vs. Tensorflow Fold

Both PyTorch and Tensorflow Fold are deep learning frameworks meant to deal with situations where the input data has non-uniform length or dimensions (that is, situations where dynamic graphs are ...
noe's user avatar
  • 20.7k

1
10 11 12 13
14