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

How can my Pytorch based GAN output pure B&W with no grayscale?

My goal is to create simple geometric line drawings in pure black and white. I do not need gray tones. Something like this (example of training image): But using that GAN it produces gray tone images....
0
votes
0answers
3 views

Action selection in actor-critic algorithm:

I have an action space that is just a list of values given by acts = [i for i in range(10, 100, 10)]. According to pytorch documentary, the loss is calculated as below. Could someone explain to me how ...
0
votes
0answers
10 views

torchvision Dataloader using “transforms”

I made a torchvision.datasets dataloader for torchvision.datasets.SBDataset : ...
0
votes
1answer
22 views

Problem when using Autograd with nn.Embedding in Pytorch

I am in trouble with taking derivatives of outputs logits with respect to the inputs input_ids. Here is an example of my input: ...
0
votes
0answers
12 views

Help me understand the pytorch translation of this mathemetical equation

I am looking at the second problem of the homework solution from the course unsupervised learning here. Can someone explain how does the author convert this equation: $p_\theta(x) = \sum_{i=1}^4 \...
0
votes
0answers
6 views

Projected gradient descent in keras

I am currently working on a project and I need to do project gradient descent instead of vanilla gradient descent on a network. I am unsure if current deep learning frameworks have that functionality. ...
1
vote
1answer
14 views

The meaning of γt−t0 in Reinforcement learning with pytorch

When reading pytorch tutorial: Our aim will be to train a policy that tries to maximize the discounted, cumulative reward Rt0=∑∞t=t0γt−t0rt, where ...
0
votes
1answer
16 views
0
votes
0answers
15 views

Transformer seq2seq model and loading embeddings from XLM-RoBERTa

Is it possible to feed embeddings from XLM- RoBERTa to transformer seq2seq model? I'm working on NMT that translates verbal language sentences to sign language sentences (e.g Input: He sells food. ...
0
votes
1answer
25 views

Use embeddings to find similarity between documents

I need to find cosine similarity between two text documents. I need embeddings that reflect order of the word sequence, so I don't plan to use document vectors built with bag of words or TF/IDF. ...
0
votes
1answer
16 views

Classification with a lot of the classes

I’m trying to make model which will classify text into about 500 different classes. I think that I have to customize architecture of the Pooling Classifier which looks now like this: ...
1
vote
0answers
36 views

Constraining a neural net during training

I have simple "image-like" objects that contain non-linearly encoded information about real images. Each real image is zero except for two pixels, whose float values sum to unity. I created a simple ...
0
votes
1answer
16 views

UNet Model accuracy is stuck at exact 0.5 (neither more or less) (No class imbalance, tried tuning learning rate)

This is using PyTorch I have been trying to implement UNet model on my images, however, my model accuracy is always exact 0.5. Loss does decrease. I have also checked for class imbalance. I have ...
0
votes
0answers
33 views

PyTorch Dataset/DataLoader workflow with multiple .h5 files

I have multiple .h5 files, totaling 50GB, all of the same two-column format (first column: value, second column: label). I only have enough RAM to load one .h5 file at a time. I am unsure on how to ...
1
vote
1answer
22 views

Can VAEs be used to generate multivariate data?

Most of the tutorials online seem to use VAEs to generate images and use CNNs to generate data. I am working on a game with multivariate data consisting of character position and the character ...
0
votes
0answers
36 views

How can I get testing accuracy using tensorboard for Detectron2?

I'm learning to use Detecron2. I've followed this link to create a custom object detector. My training code - ...
0
votes
1answer
42 views

LSTM Multi-class classification for large number of classes

I want to build a model that classifies 473 classes -product categories-, but I'm facing a problem with loss not decreasing. Data I have almost 3,000 data points for each class -473 classes- (data ...
1
vote
1answer
19 views

Should weight distribution change more when fine-tuning transformers-based classifier?

I'm using pre-trained DistilBERT model from Huggingface with custom classification head, which is almost the same as in the reference implementation: ...
0
votes
0answers
11 views

What is the advantage of Automatic Differentiation over Symbolic or Numerical Differentiation?

I have read that Automatic Differentiation(AD) is comparatively faster to optimize the learning rate of a model. But what is AD's advantage over Symbolic Differentiation or Numerical Differentiation?
0
votes
0answers
11 views

Project structure ML time-series forecasting

I'm about to start with a ML learning time-series forecasting project which includes large-quantities of (2-million) time-series stored in JSON-files. The first step will involve feature engineering....
0
votes
0answers
15 views

Using Images uploaded in google drive in Colab

Does anyone know how to use already uploaded images in Google Drive to colaboratory for creating a trainloader? I'm creating the trainloader and model in Pytorch
0
votes
0answers
24 views

Training loss/accuracy fluctuates too much when using CutMix regularization

Recently I read about the CutMix data augmentation technique from this paper and I'm trying to implement it on CIFAR-10 dataset. Here is my implementation from the given pseudocode: ...
0
votes
0answers
18 views

How can I create a basic RNN for audio with PyTorch?

I am trying to have my RNN learn to take corrupted audio files and clean them. To that end, I see that I need to convert to MFCC and use that instead of raw time ...
2
votes
1answer
83 views

Transfer Learning Question: Extending the Functionality of a Multipose-Estimation Machine Learning Model?

I have experimented with a number of different machine learning models used for pose estimation. Most of them output a heatmap and offsets for the detected person(s) in the image. I really like the ...
0
votes
0answers
27 views

How could I make the bert friendly dataset?

I want to create the bert train,test dataset from the pandas dataframe ...
0
votes
0answers
12 views

Can one hardcode convolutional filters to detect characters in a CNN?

In Pytorch, you can hardcode your filters to be whatever you like. At the moment, I'm doing text detection and I need to identify the location of a certain information. This information always ...
0
votes
0answers
19 views

GridSearchCV and PyTorch with skorch shows error 'Invalid parameter lr' [duplicate]

I want to use sklearn's GridSearchCV in combination with PyTorch and use Skorch for compatibility. However, I receive an error telling me that ...
1
vote
0answers
26 views

why keras gives me desired results for my Entity Embedding but not pytorch?

I tried to build Entity Embeddings of categorical data from a dataset. I took a dataset - "Bike share”.This dataset shows number of bike share/rent/sales in every ...
0
votes
0answers
28 views

Torch and TensorFlow: Is Variable(torch.cuda.FloatTensor([x]) equivalent to tf.convert_to_tensor([x])?

I would like to ask you if this: Variable(torch.cuda.FloatTensor([x]), requires_grad=False) in Torch is the equivalent to this: ...
2
votes
1answer
23 views

Magnifying or reducing the size of input groups into a neural network

Say you've got two inputs (X1 and X2) that you want to use to predict Y. You're not sure how important X1 and X2 are for predicting Y, but you assume about even. One-hot encoding is a good strategy ...
1
vote
1answer
32 views

Image Super-resolution Connecting Subimages

I'm working with image super-resolution on terrain height data. Currently, I'm cutting the input data into smaller pieces (20 x 20 rather than 10800 x 10800). After the upscale 20x20 -> 40x40, ...
0
votes
0answers
44 views

Pytorch-geometric for Node2Vec graph embedding

Does pytorch-geometric's node2vec implementation change transition probabilities based on edge weights similar to the original implementation of the paper? Looking at the code it does not look like. ...
2
votes
1answer
43 views

batched CrossEntropyLoss in pytorch

I'm wondering how to implement this with pytorch built-ins. I've got a 3 dimensional input of uints called policy. Most of the entries are zero, and if I were to L1 normalize this I would have a (...
1
vote
1answer
220 views

How does BERT and GPT-2 encoding deal with token such as <|startoftext|>, <s>

As I understand, GPT-2 and BERT are using Byte-Pair Encoding which is a subword encoding. Since lots of start/end token is used such as <|startoftext|> and , as I image the encoder should encode ...
1
vote
0answers
32 views

Where can I get pre-trained weights for character recognition?

I'm doing a simple pipeline and I need a digit recognition algorithm. There are definitely pre-trained weights out there for character recognition, but I can't find them. They can be in Keras, ...
1
vote
0answers
66 views

Compute loss gradient w.r.t. inputs of Bayesian Neural Network using Pyro

Suppose I inferred the parameters of all the posterior distributions for a BNN using Pyro. In particular, the implementation uses the HiddenLayer class: ...
3
votes
1answer
25 views

How to quantitatively evaluate raw neural network activations?

Below are the activations for 2 different predictions. These predictions are for different labels/classes. They are being run through a dense Keras NN (96.6% accurate) with 2 hidden layers and adam ...
1
vote
0answers
51 views

PyTorch Faster R-CNN ResNet50 - support for occlusion?

Currently I'm using the PyTorch model Faster R-CNN ResNet50. I instantiate this as follows: ...
2
votes
1answer
69 views

Multilingual Bert sentence vector captures language used more than meaning - working as interned?

Playing around with BERT, I downloaded the Huggingface Multilingual Bert and entered three sentences, saving their sentence vectors (the embedding of [CLS]), then ...
0
votes
1answer
39 views

How neural style transfer work in pytorch?

I am using this pytorch script to learn and understand neural style transfer. I understood most part of the code but having some hard time understanding some parts of the code. In ...
2
votes
1answer
34 views

Row-wise Jacobian with pytorch

Suppose I have $f:\mathbb{R}^{d_i}\to\mathbb{R}^{d_o}$. Let $X \in \mathbb{R}^{n \times d_i}$ and I apply $f$ to each row of $X$, obtaining $Y = f(X) \in \mathbb{R}^{n \times d_o}$. I would like to ...
1
vote
2answers
98 views

PyTorch: How to use pytorch pretrained for single channel image

If I have to create a model in pytorch for images having only single channel. How can I transform my model to adopt to this new architecture without having the need to compromise the pre-trained ...
1
vote
0answers
36 views

Tiny Video Network

According to this: ...
0
votes
0answers
10 views

GIven some similar pictures,how to detect and mark the differences among these picture by deep learning

Now i have certain images ,they can be classfied into tow groups :right and false .However, two sorts just have small differnece in the detail . (for example ,I possess two maps. Their content is ...
1
vote
0answers
20 views

Churn rate prediction based on sequencial data

I am trying to build a machine learning model that can predict if a certain user will churn based on its historical static and dynamic data. The data looks like below: ...
0
votes
0answers
27 views

TypeError: Cannot handle this data type when changing the Dataset's data

trainloader = utilsxai.load_data_cifar10(batch_size=1,test=False) this is my dataset from torchvision ...
0
votes
1answer
297 views

How to calculate perplexity in PyTorch?

I am wondering the calculation of perplexity of a language model which is based on ...
1
vote
0answers
39 views

Place of backward and its relation with batches in PyTorch

I am implementing a dependency parsing model using PyTorch and little bit confused about the situation that I explained below. When calculating loss and backward the model; I tried different things. ...
0
votes
1answer
55 views

CrossMapLRN2d in pytorch

I had to convert a code written in pytorch to keras (with tensorflow backend). But there was this layer called CrossMapLRN2d which had no direct counterpart in Keras. So wanted to know what does this ...
0
votes
0answers
10 views

Jupyter notebook memory consumption while training vs script

Anyone seeing this issue where, when you're training a model with torch on Jupyter Notebook your GPU memory utilization is more than if it was a python script? Ran the same notebook through a script ...

1
2 3 4 5 6