Questions tagged [pytorch]

For conceptual questions that somehow involve the PyTorch library, but note that programming questions are off-topic here.

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

Fine tune bert to get contexualized embedding

I need to use BERT contextual embedding instead of stochastic Answer network in this model. And for generating the responsed in the same model, I would like to use the generator. Could any one help to ...
0
votes
0answers
26 views

Training Object Detection model on just 10 images

I am trying to train an object detection model using Mask-RCNN with Resnet50 as backbone. I am using the pre-trained models from PyTorch's Torchvision library. I have only 10 images that I can use to ...
0
votes
0answers
14 views

Cause of Exploding NLLLoss [migrated]

I have been trying to make Transformer based language model, for the loss function Negative Log-likelihood is implemented. For some reason, after a few iterations, there is a steep increase in ...
0
votes
0answers
15 views

Transformer Language model produces only <pad> tokens when generating new sentences

I am training a word-level language model using the transformer module available in Pytorch. I am getting a really good training loss and the model is able to reproduce the sentences in the training ...
0
votes
0answers
25 views

Pytorch and keras ddqn seem identical, only keras learns

I followed a tutorial for ddqn to beat pong, it beats it with a perfect score in keras, but trying to translate it to pytorch it doesn't learn at all. What am I missing? I pasted all the code for each ...
0
votes
1answer
43 views

How to use validation dataset in my logistic regression model?

I am new to machine learning and recently I joined a course where I was given a logistic regression assignment in which I had to split 20% of the training dataset for the validation dataset and then ...
0
votes
0answers
16 views

Multi-label dataloading bottleneck Pytorch

I am trying to write custom dataset and dataloader for pascal-voc-2007. It is a multi-label classification problem. There is csv file to hold the name of the images and their corresponding labels. I ...
0
votes
0answers
54 views

Transformer Language Model generating meaningless text

I currently learning on Transformers, so check my understanding I tried implementing a small transformer-based language model and compare it to RNN based language model. Here's the code for ...
0
votes
0answers
29 views

How to implement or avoid masking for transformer?

When it comes to using Transformers for image captioning is there any reason to use masking? I currently have a resnet101 encoder and am trying to use the features as the input for a transformer model ...
1
vote
1answer
39 views

Pytorch Deep q network not learning and step not stepping towards target

I am trying to create a simple deep q network for rl with conv2d layers. I can’t figure out what I am doing wrong, and the only thing I can see that doesn’t seem right is when I get the model ...
0
votes
1answer
21 views

Why would the reward of A3C with LSTM suddenly drop off after many episodes?

I am training an A3C with stacked LSTM. During initial training, my model was giving descent +ve reward. However, after many episodes, its reward just goes to zero and is continuing for a long time. ...
0
votes
0answers
13 views

How to use an image tensor for caption generation with Transformer-XL or BERT?

I am fairly new to transformers and deep learning in general so please be kind, I am currently working on a project that will caption images using either Transformer-XL or BERT, however, I am not sure ...
1
vote
0answers
14 views

is it ok to take random actions while training a3c as in below code

i am trying to train an A3C algorithm but I am getting same output in the multinomial function. can I train the A3C with random actions as in below code. can someone expert comment. ...
0
votes
1answer
72 views

Feeding YOLOv4 image data into LSTM layer?

How would one extract the feature vector from a given input image using YOLOv4 and pass that data into an LSTM to generate captions for the image? I am trying to make an image captioning software in ...
0
votes
0answers
29 views

Class activation maps for 3D Convolutional neural network?

I have implemented a 3D convolutional neural network and I was not able to find resources for interpretation for my model. I have found some techniques such as GradCam and GradCam++ but these generate ...
0
votes
0answers
27 views

Why does my loss value of autoencoder in PyTorch is negative?

I am trying to implement SDNE, a algorithm uses deep auto encoder to map a graph to latent representation d dimension. The idea is kind of simple, SDNE uses the ...
0
votes
1answer
23 views

Get Neural Network to predict a tag/class on a certain word using the surrounding words as context [PyTorch]?

I am somewhat a novice at the topic of Neural Netoworks and PyTorch. I am trying to create a model that takes a word (that I have modified very slightly) and a 'window' of context around it and ...
0
votes
0answers
14 views

Automated Scoring (non-english language) Using BERT

i'm a student and i'm new to NLP. I want to build an Automated Scoring system which is in Indonesian Language using BERT. The system is expected to be able to measure the similarity of an answer(e.g: ...
0
votes
0answers
20 views

Descent Training episodes for LSTM + TD3

I am building an AI with TD3 and lstm in both actor and critic. By LSTM size is 5,5 with 3 layers and hidden layers with 400 and 300 neurons respectively. I have states dimension of 5 with each value ...
0
votes
0answers
20 views

TD3+lstm predicting the same output for varying states

I have a model with TD3 + lstm in both actor and critic. I am trying to make it learn to predict some specific actions based on the environment conditions. However i see that the AI predicts very ...
0
votes
1answer
67 views

Is it possible to have a fixed trajectory size in the vanilla policy gradient algorithm?

In the concept of the vanilla policy gradient algorithm, is it possible for our trajectory size to be fixed? For example, my environment is the space of embedded images (using a pre-trained encoder to ...
1
vote
0answers
46 views

Is it good practice to save NLP Transformer based pre-trained models into file system in production environment

I have developed a multi label classifier using BERT. I'm leveraging Hugging Face Pytorch implementation for transformers. I have saved the pretrained model into the file directory in dev environment. ...
1
vote
0answers
53 views

Classification or regression for deep Q learning

DQN implemented at https://github.com/PacktPublishing/PyTorch-1.x-Reinforcement-Learning-Cookbook/blob/master/Chapter07/chapter7/dqn.py uses the mean square error loss function for the neural network ...
1
vote
1answer
59 views

Why is the policy loss the mean of $-Q(s, \mu(s))$ in the DDPG algorithm?

I am trying to implement the DDPG algorithm based on this paper. The part that confuses me is the actor network's update. I don't understand why the policy loss is simply the mean of $-Q(s, \mu(s))$, ...
0
votes
0answers
27 views

How do I get my DCGAN to generate a number of fake images?

I have a Deep Convolutional Generative Adversarial Network (DCGAN) that trains on the CIFAR dataset. When I finish the training (100k epochs), how can I make my network generate 1000 fake images? I ...
0
votes
1answer
60 views

Input tensor shape order for RNN (PyTorch)

I am confused as to why the sequence length is the first dimension of the input tensor for an RNN when batch size is the first dimension for any other kind of network (Linear/CNN/etc.). This makes me ...
0
votes
1answer
29 views

How is it possible to get the output size of `n` Consecutive Convolutional layers? [closed]

Given network architecture, what are the possible ways to define fully connected layer fc1 to have a generalized structure such as ...
1
vote
0answers
43 views

In layman's terms, what is stochastic computation graph?

I'm going through the distributions package on PyTorch's documentation and came across the term stochastic computation graph. In layman's terms, what is it?
1
vote
0answers
45 views

Policy Gradient on Tic-Tac-Toe not working

I wanted to implement the Policy Gradient on Tic-Tac-Toe. I tried to use the code that worked for any environment like CartPole-v0 to my Tic-Tac-To game. But it is not learning. There are no errors. ...
2
votes
1answer
305 views

Why isn't my implementation of A2C for the the atari pong game converging?

I have two different implementations with PyTorch of the Atari Pong game using A2C algorithm. Both implementations are similar, but some portion are different. https://colab.research.google.com/drive/...
2
votes
2answers
181 views

Advantage computed the wrong way?

Here is the code written by Maxim Lapan. I am reading his book (Deep Reinforcement Learning Hands-on). I have seen a line in his code which is really weird. In the accumulation of the policy gradient $...
1
vote
0answers
46 views

Benchmarking SAC on Pybullet

So far I have seen TD3 and DDPG benchmarks on Pybullet environments, but I am looking for SAC benchmarks on Pybullet too, anyone can help?
1
vote
0answers
38 views

What are the procedures to get RL paper results? [closed]

I finished working on a new algorithm in Reinforcement Learning, I need to compare it to some well-known algorithms. That's why I need to know the step-by-step procedures that RL researchers usually ...
1
vote
1answer
121 views

Once the environments are vectorized, how do I have to gather immediate experiences for the agent?

My main purpose right now is to train an agent using the A2C algorithm to solve the Atari Breakout game. So far I have succeeded to create that code with a single agent and environment. To break the ...
1
vote
1answer
91 views

What does the notation $\partial \theta_{\pi}$ mean in this actor-critic update rule?

One of the steps in the actor-critic algorithm is $$\partial \theta_{\pi} \gets \partial \theta_{\pi} + \nabla_{\theta}\log\pi_{\theta} (a_i | s_i) (R - V_{\theta}(s_i))$$ For me, $\theta$ are just ...
1
vote
0answers
42 views

What is the difference between FC and MLP in as used in PointNet?

I am trying to understand the PointNet network for dealing with point clouds and struggling with understanding the difference between FC and MLP: "FC is fully connected layer operating on each ...
1
vote
0answers
33 views

How can I use GPT-2 to modify seed text of one form into a different form (LENGTH INVARIANT) whilst retaining meaning?

I am currently starting a research project whereby I am trying to convert text of one form into another. i.e. If I were to write a seed sentance of the form "Scientists have finally achieved the ...
1
vote
0answers
156 views

Replace epsilon greedy action selection and the standard DQN by an Independent Gaussian Noise Network Model

Here is my code Recently, I solved the game of Atari Breakout using a classic DQN model. The convergence of the mean reward slowly improved during three days. I was interested in learning a method ...
1
vote
1answer
48 views

Why are the rewards of my RL agent for the Atari Breakout game decreasing after a certain number of episodes?

The agent is trying to master the Atari Breakout game. Here is my code Is that normal that reward_100 decreased that much after it hits 4.5? Is there a way to ...
1
vote
1answer
43 views
2
votes
0answers
49 views

Why does GAN loss converge to log(2) and not -log(2)?

In Goodfellow's paper, he says: Hence, by inspecting Eq. 4 at $D^*_G (\mathbf{x}) = \frac{1}{2}$, we find $C(G) = \log \frac{1}{2}+ \log \frac{1}{2} = − \log 4$. To see that this is the best ...
0
votes
1answer
98 views

Can you train Transformers sequentially?

I’m currently trying to train a BART, which is a denoising Transformer created by Facebook researchers. Here’s my Transformer code ...
1
vote
0answers
38 views

Is it possible to do token classification using a model such as GPT-2?

I am trying to use PyTorch's transformers as a part of a research project to do sentiment analysis of several types of review data (laptop and restaurant). To do this, my team is taking a token-...
1
vote
1answer
46 views

time-series prediction : loss going down, then stagnates with very high variance

I am trying to design a model based on LSTM cells to do time-series prediction. The ouput value is an integer in [0,13]. I have noticed that one-hot encoding it and ...
1
vote
0answers
54 views

What are the pros and cons of Keras, PyTorch and Caffe for computer vision?

I have tried to get the basic grasp of the following deep learning frameworks with python: Keras Pytorch Caffe However, I have lately noticed that people in the computer vision community care less ...
0
votes
0answers
26 views

Which hidden state should I use for a trajectory when incorporating LSTM into RL?

I'm trying to wrap my head around using LSTM in an RL algorithm like actor-critic or PPO. I've found this Github code which presents this in a very simple manner, however I have a very limited ...
1
vote
0answers
32 views

Pytorch deep learning models and tabular data representation

I have quite a naive question regarding Pytorch deep learning models and tabular data representation. So, assume I have a dictionary of tables. Each table has some number of columns: categorical and ...
4
votes
1answer
133 views

Is there a reason to use TensorFlow over PyTorch for research purposes?

I've been using PyTorch to do research for a while and it seems to be quite easy to implement new things with. Also, it is easy to learn and I didn't have any problem with following other researchers ...
2
votes
0answers
86 views

What is the equivalent PyTorch version of tensorflow lite

Update Checked the PyTorch Mobile which is designed to Android and iOS. Although according to the document, it says it can build for ARM CPUs, but there isn't any documentation mention about how to ...
1
vote
1answer
66 views

RealNVP gives wrong probabilities

I am trying to use RealNVP with some data I have (the input size is a 1D vector of size 22). Here is the link to the RealNVP paper and here is a nice, short explanation of it (the paper is pretty long)...