Category "pytorch"

Distributed sequential windowed data in pytorch

At every epoch of my training, I need to split my dataset in n batches of t consecutive samples. For example, if my data is [1,2,3,4,5,6,7,8,9,10], n = 2 and t

Can someone help? I want to do image classification using CNN while taking pose estimated as input

I hope you're all doing well. I'm new here for help. Basically, I have hand poses and labeled data for the image. for example image class is labeled as: 1: Hol

Get ROI feature vector from Faster R-CNN using Pytorch

I am training a faster R-CNN model in pytorch and I want to extract feature vector from roi-heads layer. I am using the following code: model = torchvision.mode

Training loss much lower than test loss even though it's using the same data

I'm using the same data for training and testing (which isn't best practice), and in theory the loss should be exactly the same. However, when training, my loss

Calculating joint probabilities from two tensors of different sizes in pytorch

I am trying to calculate joint probabilities from two tensors.. It's a little bit confusing for me. Suppose we have : a = torch.Tensor((10, 2)) b = torch.Tensor

Tensorflow: Create the torch.gather() equivalent in tensorflow

I want to replicate the torch.gather() function in TensorFlow 2.X. I have a Tensor A (shape: [2, 4, 3]) and a corresponding Index-Tensor I (shape: [2,2,3]). Usi

Converting PyTorch Boolean target to regression target

Question I have code that is based on Part 2, Chapter 11 of Deep Learning with PyTorch, by Luca Pietro Giovanni Antiga, Thomas Viehmann, and Eli Stevens. It's

I'd like to change the Keras to a pytorch, but I don't know how to build a neural network

The HAR dataset should be analyzed using LSTM and 1D CNN. I need to check the graph of the change in loss and check the confusion matrix. I don't know how to ma

Convert AVAudioPCMBuffer into MLMultiArray and get prediction from CoreML model

I try to send AVAudioPCMBuffer into a coreML model and get the output from it. Input of the model is MultiArray (Float32 0 × 64 × 0) and output is M

Replace bidirectional LSTM with GRU in coref?

I am training the coarse-to-fine coreference model (for some other language than English) from Allennlp with template configs from bert_lstm.jsonnet. When I rep

I want to ask you about the structure of "query, key, value" of "transformer"

I'm a beginner at NLP. So I'm trying to reproduce the most basic transformer all you need code. But I got a question while doing it. In the MultiHeadAttention l

RuntimeError: The expanded size of the tensor (1300000) must match the existing size (80) at non-singleton dimension 0

I have following errors in my RBM code and here is the in raw. ipykernel_18388/119274704.py in v_to_h(self, v) 23 24 p_h = F.sigmoid( ---

Using Recurrent Neural Networks for binary values prediction

EDIT: The problems stated have been solved, you'll first find the solution, the initial question is stated below! SOLUTION: Applying the .unsqueeze(0) to my inp

PyTorch - Using {N,H,W,C} format in customized operation

I'm thinking about upgrading some of my customized PyTorch operations to support {N,H,W,C} format. However, I'm still confused about using channel-last-format t

Can you run the Opacus privacy engine with pytorch SequenceTaggingDataset?

I am trying to adapt a pytorch Named Entity Recognition model to incorporate differential privacy with the Opacus library. My model uses torchtext to build the

Import error: 'SimpleExperiment' while running BOTORCH example code

I am trying to work with Bayesian Optimisation for my Numerical model run, Optimising its parameters. For this I am using BoTorch. Its example code is given as

How to use nn.TransTransformerEncoder from pytorch

I am trying to use PyTorch's '''nn.TransformerEncoder''' module for a classification task. I have data points of varying lengths i.e I have sequences of differe

Pytorch's autograd issue with joblib

There seems to be a problem mixing pytorch's autograd with joblib. I need to get gradient in parallel for a lot of samples. Joblib works fine with other aspects

Combination of features of convolutional layers channel-by-channel in a multi-branch model

The convolutional model presented below, has two branches and each branch (for example) has two stages (convolutional layers). My aim is to combine the weighte

spatial domain convolution not equal to frequency domain multiplication using pytorch

I want to verify if 2D convolution in spatial domain is really a multiplication in frequency domain, so I used pytorch to implement convolution of an image with