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

Small fix in results/plot_results.py #1

Merged
merged 7 commits into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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