Skip to main content

Questions tagged [pytorch]

PyTorch is a deep learning framework that implements a dynamic computational graph, which allows you to change the way your neural network behaves on the fly and capable of performing backward automatic differentiation.

1 vote
1 answer
72 views

I have a pytorch module that takes in some parameters and predicts the difference between one of it inputs and the target

One instance of the following module uses up to almost 75% of my vram. So, I was wondering how I could improve that without slowing down runtime too much. The code is below: ...
Jayson Meribe's user avatar
3 votes
2 answers
91 views

Video Frame-by-Frame Deraining with MFDNet

After checking the repository of MFDNet, single image rain streaks removal with the provided model is given in test.py. I am trying to modify the code to process frame-by-frame rain streaks removal in ...
JimmyHu's user avatar
  • 7,068
5 votes
1 answer
94 views

Transformer based on pytorch nn.Transformer to predict protein secondary structure

I'm working on a transformer as my final project in high school. Since I'm kinda new to ML (3 months of experience), I need someone to check my implementation, if I made any mistakes or bugs that I ...
BadCoder's user avatar
5 votes
1 answer
162 views

String art program in Python using PyTorch

...
flakpm's user avatar
  • 87
3 votes
1 answer
105 views

Pytorch code running slow for Deep Q learning (Reinforcement Learning)

I'm a new student in reinforcement learning. Below is the code that I wrote for deep Q learning: ...
Jahid Chowdhury Choton's user avatar
2 votes
1 answer
45 views

One-layer linear neural network to solve a regression problem in PyTorch

Good morning everyone, I am trying to figure out how deep learning works. My approach is mainly theoretical but I have decided to code a few deep learning projects to get a better feel of the kind of ...
francescoriccardocrescenzi's user avatar
1 vote
0 answers
69 views

Convolution to reduce popcorn noise in black and white video

I have a black & white video as a tensor with the shape [Time, Width, Height] with popcorn noise and I would like to reduce the noise by naively convolving along the time dimension. Using a ...
Seanny123's user avatar
  • 1,585
3 votes
1 answer
98 views

Randomly rotate an image through right angles

I'm new to Python, and coming from Typescript, I tried to include types, but it's not obvious sometimes. Currently this is the way I type objects: Write own simple types Import type from a library ...
user avatar
1 vote
0 answers
109 views

Storing multiple PyTorch tensors of different shapes with names that are not known by advance

I need to create a container for instances of torch.Tensor of different shapes, where I can call them by their name. It is a use case for a dict except that: I don't want to rely on the heavy syntax ...
Xiiryo's user avatar
  • 111
3 votes
2 answers
164 views

Neural network that determines the gender of a word

I wrote a neural network in Python using PyTorch which determines the gender of a word in Russian. As a training set: a file containing a word and a number from 0 to 2 (0-masculine, 1-feminine and 2-...
user avatar
2 votes
0 answers
101 views

Higher order derivatives with functorch

I'm computing higher order derivatives using nested jacobian from pytorch/functorch. $$f(x, y, z, \dots) : R^{m_x} \times R^{m_y}...
I.M.'s user avatar
  • 121
1 vote
0 answers
167 views

Binary classification with pytorch

I wrote a simple neural network binary classification algorithm using Pytorch. It uses the dataset from https://www.kaggle.com/pritsheta/heart-attack, which consists of a table with 300 rows and 14 ...
user3053216's user avatar
1 vote
1 answer
650 views

Set min value of each row of a tensor to zero without using explicit loops

Here's the problem. Return a copy of x, where the minimum value along each row has been set to 0. For example, if x is: ...
Ryan's user avatar
  • 13
2 votes
1 answer
105 views

Loss function in python is a bit cumbersome

Here is a python function I have for a neural network I have implemented. I feel it become a bit cumbersome. The intention is to weight positive labels in channels ...
El_Loco's user avatar
  • 169
2 votes
1 answer
69 views

resnet with pytorch

I was studying resnet and wanted to program it with pytorch. I searched for some examples (github, google), but it was hard to understand the code completely. So I programmed resnet myself, and it ...
JayK's user avatar
  • 21

15 30 50 per page