Category "pytorch"

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

Torch shape mismatch error while training a GPT2 model

I am trying to train a GPT2 language model for text generation tasks. I am trying to include an additional embedding layer (with POS-tagging) on top of token em

Using a target size (torch.Size([2])) that is different to the input size (torch.Size([2, 5])) is deprecated. Please ensure they have the same size

When I am using criterion = nn.BCELoss() for my binary classification task it creates problem and print "Using a target size (torch.Size([2])) that is different

torch.manual_seed(seed) get RuntimeError: CUDA error: device-side assert triggered

I am using GOOGLE COLAB when I get this error. Here is my code, I didn't find anything wrong, these code were right few hour ago but suddenly went wrong, I don'

Issues with Pytorch and Torchvision on MAC M1 - python / conda

Im trying to run Pytorch and Torchvision on Mac M1. I follow these instructions successfully install pytorch and run it natively on apple - https://betterprogra

How to use multiprocess when input is a torch.tensor with gradient?

import torch.multiprocessing as mp import torch import time class test(): def __init__(self,X,Y): self.X=X #.share_memory_() self.Y=Y

Improve Python (.exe) startup time

I created an exe with the PyInstaller. As soon as I enable the --onefile flag. The exe needs several minutes to start. When I build the application with the --o

IndexError: Target 11 is out of bounds. cross-entropy

How can I change the attached model to fit my dataset for the Bayesian model? my data include 5 variables and 32 results model = nn.Sequential( bnn.BayesLin

GPU out of memory with Pyannote

I'm using Pyannote and when I run the following from pyannote.audio import Pipeline pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization") diariza

Pytorch throws CUDA runtime error on WSL2

I install Nvidia Windows Driver and CUDA according to this article. After the installation of Nvidia Windows Driver, I’ve checked CUDA version by running

Is there any faster way to get word embeddings given sub-word embeddings in BERT

Using bert.tokenizer I can get the subword ids and the word spans of words in a sentence, for example, given the sentence "This is an example", I get the encode

Training of Siamese Network with Contrastive Loss Misses Parameter Updates

I try to implement a rather simple siamese network and a contrastive loss function. I use a pre-trained VGG16 as a backbone model and strip away the last ReLU a

Inputing a torch 3d tensor into a keras.Sequential model

Here I have a pytorch tensor object which I need to use for training a neural network. Can pytorch tensors be used for training a keras neural network and if so

Define flatten layer in neural network using pytorch

I'm trying to define a flatten layer before initiating fully connected layer. As my input is a tensor with shape (512, 2, 2), so I want to flatten this tensor b

Assign memory blob to py-torch output tensor (C++ API)

I am training a linear model using py-torch and I am saving it to a file with the "save" function call. I have another code that loads the model in C++ and perf