Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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

What’s more efficient in multihead attention: multiply QKV by W_i then split or linearly project QKV h times into dimensions d_k?

I’m looking to bridge two implementations of multihead attention. Approach 1: Multiply and Split Each of the queries, keys, and values is multiplied by a separate square weight matrix of size (...
marcocamilo's user avatar
0 votes
0 answers
9 views

Incredibly High CrossEntropyLoss in Sequence-to-Sequence Generation

I'm trying to do SMILES chemical representation prediction from a large dataset (Around 5M Samples) to teach it do predict another downstream task. The model's part responsible for generating the data ...
Vivek Joshy's user avatar
0 votes
0 answers
11 views

Reinforcement Learning Gymnasium ValueError

I am testing out reinforcement learning for the first time with gymnasium. I am following a youtube tutorial. I am getting the following error when I run the training loop: ValueError: setting an ...
Sheila's user avatar
  • 1
0 votes
1 answer
37 views

Any reasons LSTM does not pick up any patterns?

I'm trying to teach an LSTM to predict the next values in 3 related series. (Financial data) Unfortunately, it looks like I made some basic mistake and this network never gets past just returning ...
viraptor's user avatar
  • 111
1 vote
0 answers
20 views

Why completely two different algorithms are being used in Deep Q Learning?

I'm a new student in reinforcement learning. Recently, I've been studying about different algorithms of RL. But I'm quite surprized that there are some algorithms which are named as "same" ...
Jahid Chowdhury Choton's user avatar
0 votes
2 answers
37 views

Neural network for specific numbers from a range (Q learning)

PROBLEM AT HAND: I have a resource (Bandwidth) of B Hz. I have to distribute the bandwidth B to users as per their requirements. For instance, voice calls would require some amount of bandwidth while ...
ANWESA ROY's user avatar
0 votes
0 answers
15 views

Graph-Level Regression Task

I'm currently working on a system that predicts energy consumption of a set of buildings using graph convolutionals networks (GCN), which is a Graph-Level regression task (1 prediction for every ...
hambam's user avatar
  • 1
0 votes
0 answers
34 views

Advice on Moving Object Segmentation with U-Net where the target is small

I have a problem I'm trying to solve. I'd like to spot a moving object in a video sequence. "Moving Object" is very vague, but it can be roughly defined as 'here is a bright point that seems ...
Oni's user avatar
  • 101
0 votes
0 answers
23 views

Why the architeture of Resnet18 is suitable to images classification?

I am studying convolutional networks and in particular I have focused on the ResNet18 network. I've been studying ResNet18 and understand the purpose of skip connections and residual network. However,...
Domme's user avatar
  • 1
0 votes
0 answers
15 views

Why does SSIM in pytorch-mssim need the data range to be specified?

The SSIM metric (https://en.wikipedia.org/wiki/Structural_similarity_index_measure) formulas do not seem to depend on the range of the values the pixel have (from 0 to 1, from 0 to 255, or any other ...
FluidMechanics Potential Flows's user avatar
0 votes
0 answers
7 views

Trying to use my first created Knowledge graph embeddings model

I'm trying to learn about creating and using knowledge graph embeddings models, I got a code, adapted it until I got no compiling or executing errors but now the predictions it mades are wrong. This ...
gnix's user avatar
  • 1
0 votes
0 answers
17 views

Multimodal architecture: how to train it

I have a set of graphs, a set of sequences and a set of summary stats, the elements in the three sets correspond to each other. I am not satisfied with the regression performance from one single ...
Tianjian Qin's user avatar
0 votes
0 answers
23 views

Influence of Unused FFN on Model Accuracy in PyTorch

I am encountering a peculiar issue with my PyTorch model where the presence of an initialized but unused FeedForward Network (FFN) affects the model's accuracy. Specifically, when the FFN is ...
Riya's user avatar
  • 1
0 votes
0 answers
25 views

Yolov8 object detection model visualization in Netron

I trained a YOLOv8 nano detection model with imgsz=320 and 36 classes. When I conver it to ONNX, I get the following message: ...
Mary H's user avatar
  • 1
0 votes
0 answers
17 views

What are some good resources to understand the code for 3D Gaussian Splatting?

I am looking for some good resources like videos or blogs (or other githubs!) that go through the code of Gaussian Splatting and explain the major components and how they are working. Haven't found ...
ChaoS Adm's user avatar
  • 101
0 votes
0 answers
27 views

What is the input size and sequence length for lstm when the input is audio data where each audio file is sampled at the rate of 3000hz?

I have music data which contains raw vocals of some indian classical and devotional songs and I have segmented each file into 20 seconds files. I have used librosa.load function with a sample rate of ...
Sai Abhishek Bhyri's user avatar
1 vote
0 answers
17 views

re-use D(fake) for optimizing both, G and D when training GANs

When training GANs, I can do this: pseudo code opt_g = Optimizer(G.params) opt_d = Optimizer(D.params) ...
Klops's user avatar
  • 111
0 votes
0 answers
10 views

Video Summary generation using DL models [video summarization]

I have asked the question here previously but no one asked so, here I am reposting the question. I am trying to summarize videos based on some Deep-learning models. On doing research, the best I found ...
Time's user avatar
  • 1
0 votes
0 answers
36 views

How to generate an image of clothing based on the image of this clothing on some model (person) while preserving details

I have a task to generate an image of clothing based on the image of this clothing on some model (person). I tried different variations of diffusion models to reach the goal, but all of them had ...
Ararat Saribekyan's user avatar
0 votes
1 answer
66 views

How do I code so that the embedding output and input share the same weight matrices?

I am trying to implement the Attention is All You Need paper from scratch. The authors mentioned in section 3.4 that "In our model, we share the same weight matrix between the two embedding ...
OneMoreGamble's user avatar
1 vote
0 answers
47 views

How to fine-tune pre-trained model? [closed]

I'm trying to classify a data set of medical images with a pre-trained model EfficientNetB0. I've written a code in Python with Pytorch to train my model and fine-tune it but I would like to know if ...
NitaStack's user avatar
0 votes
0 answers
18 views

How to structure encoder and decoder input sequences when building transformers model from scratch

I built a transformers model from scratch in PyTorch. I trained it on a novel in the public domain. My sequences are 30 tokens and the first encoder and decoder sequences, for example, are tokens 0-...
matsuo_basho's user avatar
0 votes
0 answers
46 views

What best practices for VAE do you know?

The data is binary voxel data of shape (60, 36, 60). I want to compress such data into ...
Renat Abdrakhmanov's user avatar
0 votes
1 answer
294 views

Why does the latent space in Stable Diffusion have a shape of 64x64x3?

Since the encoding is performed by a Variational Autoencoder, the VAE encoder must output some mean and log variance that we can ...
Renat Abdrakhmanov's user avatar
0 votes
1 answer
36 views

3D Unet gives "output size is too small" error [closed]

I wrote simple 3D-Unet arch in pytorch to do segmentation on 3D images. ...
user1631306's user avatar
1 vote
1 answer
123 views

Batch wise Inference to speed up Muzero's MCTS

Context: I've implemented Muzero for the game Tic-tac-toe. Unfortunately, the self-play and training is very slow (like 10 hours until it plays quite well). I ran the python profiler to find the ...
Lynix's user avatar
  • 13
0 votes
0 answers
16 views

Why is my multi-task-learning model not working?

I'm writing Python code to predict fetal head circumference using regression and classification together in a single model. The model will train to classify a fetal head image into a range (e.g., 50–...
NiStack's user avatar
1 vote
1 answer
66 views

How to make a model forget specific training it has received?

Does L1/L2 (NAdam weight decay) really make the model "unlearn"? Ok so my question might be dumb but is there any way to "unlearn" a model - and yeah I know there is wieght_decay ...
AnArrayOfFunctions's user avatar
0 votes
0 answers
175 views

Why feed forward neural network (FFN) in transformer block has a "contract and expand" pattern?

I noticed that in many (every ?) transformer architecture, the FFN (i.e the MLP network at the end of one transformer block) consists of two linear layers (with an activation) where the first layer ...
Lelouch's user avatar
  • 201
0 votes
1 answer
56 views

Does ResNext split data or copy it?

I have been learning how to create ResNext neural networks, and am confused how input works with cardinality. In this answer, it seems that it's saying that the data is added together, which I assumed ...
eop3's user avatar
  • 11
-1 votes
1 answer
327 views

Difference between FLAX and pytorch

I am going through a code written in FLAX instead of pytorch .Can someone please explain what is the difference between these two deep learning frameworks?
akhil's user avatar
  • 9
0 votes
1 answer
38 views

How to Create a 1D Embedding from Tensors of Varying Sizes?

I am a newbie in AI and playing with some computer vision algorithms. I have three tensors with different sizes. Noise augmentation levels tensor with size (N, C, H, W), diffusion timestep tensor of ...
Pooya Kamranjam's user avatar
0 votes
0 answers
39 views

How to detect abnormal fetal head size with image classification?

I am a computer science student currently working on my final project, which involves finding a classification-based solution for predicting the head size of a fetus during its third month. Here is a ...
NitaStack's user avatar
0 votes
0 answers
37 views

What am I doing wrong that result in a graph indicating better gradients in non-scaled dot-product attention compared to the scaled version?

I'm trying to visualize how the gradients change as we're increasing $d_{k}$ in the scaled dot-product attention and compare it to its non scaled version but I'm failing to produce a reasonable graph ...
Daviiid's user avatar
  • 575
-1 votes
1 answer
50 views

add a layer in deep learning model pytorch [closed]

I have a deep learning model, and I want to add a attention layer in pytorch. in the forward function, I add the attention as this: however, when I check the weights of the attention, all of the ...
Sadcow's user avatar
  • 99
0 votes
0 answers
46 views

What else could I try to avoid catastrophic forgetting in my implementation of Semi-Gradient SARSA?

I was trying to implement the semi-gradient SARSA algorithm (see p.244 Reinforcement Learning: An Introduction) using PyTorch: ...
kklaw's user avatar
  • 185
1 vote
1 answer
87 views

Is there any advantage to providing multi-dimensional input to torch modules?

Most layer types in torch.nn such as torch.nn.Linear accept input with more than one dimension. Is there any advantage in doing so if you can shape your data to represent a certain arrangement in ...
kot's user avatar
  • 13
1 vote
0 answers
43 views

Integrated gradients on text to text models

I am trying to apply integrated gradients (using library captum) on a text generation model. Specifically, it is a model that generates patches for input buggy code. I want to know if applying the ...
Nimantha's user avatar
  • 111
0 votes
0 answers
91 views

ST-GCN: graph convolution operator in Geometry-Aware Interaction Network (GAIN)

I need help implementing the model in this paper: They have adopted spatio-temporal graph convolution operator in ST-GCN [section 3.1.2]. I've found there is popular libraries available for GCN: ...
Kholdarbekov's user avatar
0 votes
1 answer
38 views

Multiple Loss Functions For Proper Parameter Updates [closed]

I am working on a model on PyTorch where it has two loss functions each fed from two separate input datasets. I want to update the model parameters based on these loss functions, ic_loss, res_loss, ...
Burak Karaosmanoğlu's user avatar
1 vote
0 answers
474 views

Training/Fine Tuning LLaVa

We wanted to fine-tune LLaVa model on some custom set of images. I wanted to know the Dataset format required for training and then finetuning.
Anonymous Atom's user avatar
1 vote
0 answers
185 views

Diffusion Model Failing to Learn

I'm trying to train a diffusion model to map between paired embedding spaces - ie using a CLIP text embedding to predict a CLIP image embedding. I have a working baseline model that predicts the ...
Karl's user avatar
  • 206
0 votes
1 answer
236 views

How to force Transformer to give more weight to certain tokens

I'm developing an encoder-decoder based transformer model and I would like to ask if there are ways to incentivize or penalize certain tokens during training. I'm working on a translation task where ...
jasperagrante's user avatar
-1 votes
1 answer
129 views

What is GNN Cheatsheet in PyG Docs [closed]

I am going through the Pytorch Geometric documentation: https://pytorch-geometric.readthedocs.io/en/latest/index.html which is built on Pytorch .Here they mentioned about GNN Cheatsheet: https://...
akhil's user avatar
  • 9
0 votes
2 answers
334 views

I'm trying to understand the use model for different Python libraries

I'm new to ML/AI field, and after completing several free university courses from MIT OpenCourseWare and Harvard CS50, I've gained some familiarity with the theoretical foundations of Artificial ...
Boris L.'s user avatar
  • 109
0 votes
0 answers
57 views

Machine learning network design for 2D point prediction labeling

I'm looking to develop a basic neural network for labeling a detected set of 2D points. I've generated a random set of 3D points within a certain radius, all of which lie on a flat plane (Y value is 0)...
colyton's user avatar
0 votes
1 answer
61 views

Why Does the Model not Improve in PyTorch?

I have a simple curve fitting problem in hand. I wrote some code in PyTorch as follows: ...
Burak Karaosmanoğlu's user avatar
0 votes
0 answers
40 views

Understand Memory Usage of Pytorch Tensors for Inference

I plan on translating large text corpora from various languages to english with Large Language Models. Therefore, I tried messing around a bit to see the computational limits of my machine. ...
Max's user avatar
  • 1
0 votes
0 answers
27 views

Does splitting a model across multiple GPUs (using model parallelism) reduce model accuracy?

When training a model in PyTorch on multiple GPUs, it should ideally give the same results as using just one GPU. However, are there any specific things to be careful about during implementation?
willtryagain's user avatar
2 votes
2 answers
110 views

Is it possible to reconstruct convolutional layers' input using transposed convolution?

I've been trying to visualize internal activations in CNN and came across this paper: "Visualizing and Understanding Convolutional Networks" by Zeiler & Fergus. In the paper they ...
Shawn Li's user avatar
  • 143

1
2 3 4 5 6