Skip to content
Snippets Groups Projects
Unverified Commit 4ada0cbd authored by Shamith Achanta's avatar Shamith Achanta Committed by GitHub
Browse files

Update benchmarks.py

parent c5cbf3cb
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ import torch
from torch.autograd import Variable
def bird(x):
def birdy(x):
flat = x.dim() == 1
if flat:
x = x.view(1, -1)
......@@ -274,4 +274,4 @@ rotatedstyblinskitang.dim = 0
def generate_orthogonal_matrix(ndim):
x = torch.exp(torch.sin(torch.linspace(-ndim ** 0.5, ndim ** 0.5, ndim)))
gram_mat = torch.exp(-(x.unsqueeze(1).repeat(1, ndim) - x.unsqueeze(0).repeat(ndim, 1)) ** 2)
return torch.qr(gram_mat)[0]
\ No newline at end of file
return torch.qr(gram_mat)[0]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment