python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to minimize the number of values that are not 0?
If my output is a tensor of values:
torch.tensor([0.0, 1.2, 0.1, 0.01, 2.3, 99.2, -21.2])
I'm trying to create a differentiable loss function that will minimize the number of values that are not 0. T...

Penguin
Votes: 0
Answers: 0
Install tensorflow 1.15 failed with pytorch in anaconda
I am trying to install tensorflow-gpu with conda, and my OS is Ubuntu 18.04.3 LTS. But got this error:
conda install tensorflow-gpu==1.15.0
Collecting package metadata (current_repodata.json): done
S...

marlon
Votes: 0
Answers: 1
Is this the right way to compute cosine similarity in PyTroch?
cos = torch.nn.CosineSimilarity(dim=-1, eps=1e-6)
c = torch.FloatTensor([1, 2, 4])
b = torch.FloatTensor([1, 2, 3])
simi = cos(b,c)
tensor(0.9915)
I am using dim=-1 in this funciton, does that mean i...

marlon
Votes: 0
Answers: 1
Torch taking 4X time than keras
We have a run a LSTM Model for binary classification having multiple sequential inputs whose output is concatenated for classification. Below is the torch model.
import pandas as pd
import time
from ...
Akshay Verma
Votes: 0
Answers: 0