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

How is a tensor implemented? How does it adjust for covariant/contravariant?

This stackoverflow question answers how tensors represent data, but not how they adjust for covariance/contravariance. I'm interested in understanding how the coupling of tensors with each other is ...
1
vote
0answers
34 views

What's the best way to take a list of lists as DQN input?

I have my own environment for the DQN algorithm. In my environment, the state space is represented by a list of lists, where each sublist can be of different lengths. In my case, the length of the ...
0
votes
0answers
17 views

Includes only some features of the dataset in a dataloader [closed]

I created a dataset and to creat a dataloader with Pytorch. I have the following problem, I would like to create a dataloader with only the features data and y_vector. As I apply torch.utils.data....
0
votes
0answers
23 views

Are there any good tutorials on using continuous normalizing flows (with PyTorch)?

I just have a very general question. Are there any good tutorials on using continuous normalizing flows? I'd say I have a decent understanding of normalizing flows, but not their continuous variant. I'...
1
vote
0answers
72 views

Why does the VAE using a KL-divergence with a non-standard mean does not produce good images?

I know I can make a VAE do generation with a mean of 0 and std-dev of 1. I tested it with the following loss function: ...
2
votes
1answer
65 views

How to incorporate a symmetry constraint in the loss function to train a CNN?

I have a task of extremely sparse binary segmentation, i.e. the segmentation mask contains either 0 or 1, and there are ~95% zeros and only ~5% ones. I use the focal loss to address the sparseness (...
0
votes
0answers
14 views

How to deal with dynamically changing input tensor in neural networks without padding?

I have a dataset about the monitored health/growth of a community of people. The dataset has tensor shaped (batch_size, features, person, window), where: person==...
0
votes
0answers
18 views

Conversion of convolution filter weights between NCHW and NHWC formats

Popular deep learning frameworks have different default data formats (PyTorch with NCHW, TensorFlow with NHWC), which lead to published pretrained models with weights that may have an incompatible ...
0
votes
0answers
14 views

feeding a NN with tensors with varying spatial dimensions

I have a huge dataset where I have a tensor with 535 channels but varying spatial dimension (but always a square) it can vary from ...
2
votes
1answer
41 views

Is it possible to train one part of the network with a particular learning rate and the other part with a different one?

I have a combined network consisting of two parts: one is for images and the other is for numerical data. Each sample is matched with a numerical case by an ID. For this combined network, a ...
1
vote
0answers
21 views

variational auto encoder loss goes down but does not reconstruct input. out of debugging ideas

My variational autoencoder seems to work for MNIST, but fails on slightly "harder" data. By "fails" I mean there are at least two apparent problems: Very poor reconstruction, for ...
2
votes
1answer
61 views

Can TensorFlow, PyTorch, and other mainstream ML frameworks be used for research-grade work in AI?

Many authors of research papers in AI (e.g. arXiv) write their neural networks from the ground-up, using low-level languages like C++ to implement their theories. Can existing open source frameworks ...
0
votes
1answer
113 views

Transformers: How to use the target mask properly?

I try to apply Transformers to an unusual use case - predict the next user session based on the previous one. A user session is described by a list of events per second, e.g. whether the user watches ...
2
votes
0answers
21 views

How will the filter size affect the transpose convolution operation?

After a series of convolutions, I am up-sampling a compressed representation, I was curious what is the methodology I should follow to choose an optimum kernel size for up-sampling. How will the ...
0
votes
1answer
42 views

How to use a conv2d layer after a flatten?

I am not familiar with Deep learning and Pytorch. And I want to know how to deal, in general with such a situation. So, I was wondering if I used a pretrained model (EfficientNet for example) if I ...
0
votes
0answers
30 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
20 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
31 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
49 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
30 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
57 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
1answer
56 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
42 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
32 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
14 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
15 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
108 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
42 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
37 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
25 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
18 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
21 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
21 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
77 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
59 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
89 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
61 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
28 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 ...
1
vote
1answer
146 views

In PyTorch, why does the sequence length need to be provided as the first dimension of the input tensor for an RNN?

I am confused as to why the sequence length is the first dimension of the input tensor for an RNN, while the batch size is the first dimension for any other kind of network (linear, CNN, etc.). This ...
0
votes
1answer
31 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
50 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
56 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
463 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
184 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
49 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
40 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
131 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
96 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
50 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
51 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 ...