Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from TLESORT/master
Browse files Browse the repository at this point in the history
Small fix in  results/plot_results.py
  • Loading branch information
lopezpaz committed Mar 8, 2018
2 parents 1919989 + 459db99 commit 2e20776
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pt
*.txt
*.pyc
*.pdf
*.tar.gz
*.npz

/data/raw/cifar-100-python
15 changes: 12 additions & 3 deletions data/raw/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
import subprocess
import pickle
import torch
import os

cifar_path = "cifar-100-python.tar.gz"
mnist_path = "mnist.npz"

print(os.path.exists(cifar_path))

if not os.path.exists(cifar_path):
# URL from: https://www.cs.toronto.edu/~kriz/cifar.html
subprocess.call("wget https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz", shell=True)

# URL from: https://www.cs.toronto.edu/~kriz/cifar.html
subprocess.call("wget https://www.cs.toronto.edu/~kriz/cifar-100-python.tar.gz", shell=True)
subprocess.call("tar xzfv cifar-100-python.tar.gz", shell=True)

# URL from: https://github.com/fchollet/keras/blob/master/keras/datasets/mnist.py
subprocess.call("wget https://s3.amazonaws.com/img-datasets/mnist.npz", shell=True)
if not os.path.exists(mnist_path):
subprocess.call("wget https://s3.amazonaws.com/img-datasets/mnist.npz", shell=True)

def unpickle(file):
with open(file, 'rb') as fo:
Expand Down
2 changes: 1 addition & 1 deletion results/plot_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
matches = glob(model + '*' + dataset + '*.pt')
if len(matches):
data = torch.load(matches[0], map_location=lambda storage, loc: storage)
acc, bwt, fwt = data[3][5:]
acc, bwt, fwt = data[3][:]
barplot[dataset][model]['acc'] = acc
barplot[dataset][model]['bwt'] = bwt
barplot[dataset][model]['fwt'] = fwt
Expand Down

0 comments on commit 2e20776

Please sign in to comment.