Spaces:
Runtime error
Runtime error
reset model weights and deleted metrics
Browse files- app.css +0 -1
- app.py +3 -12
- metrics.json +0 -1
- model.pth +0 -3
- optimizer.pth +0 -3
app.css
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
body {
|
2 |
background-image: url("mnist-dall.jpg");
|
3 |
-
background-color: #cccccc;
|
4 |
}
|
|
|
1 |
body {
|
2 |
background-image: url("mnist-dall.jpg");
|
|
|
3 |
}
|
app.py
CHANGED
@@ -76,7 +76,7 @@ class MNISTAdversarial_Dataset(Dataset):
|
|
76 |
return img, label
|
77 |
|
78 |
class MNISTCorrupted_By_Digit(Dataset):
|
79 |
-
def __init__(self,transform,digit,limit=
|
80 |
self.transform = transform
|
81 |
self.digit = digit
|
82 |
corrupted_dir="./mnist_c"
|
@@ -114,15 +114,13 @@ class MNISTCorrupted_By_Digit(Dataset):
|
|
114 |
|
115 |
|
116 |
|
117 |
-
|
118 |
-
|
119 |
class MNISTCorrupted(Dataset):
|
120 |
def __init__(self,transform):
|
121 |
self.transform = transform
|
122 |
corrupted_dir="./mnist_c"
|
123 |
files = [f.name for f in os.scandir(corrupted_dir)]
|
124 |
-
images = [np.load(os.path.join(os.path.join(corrupted_dir,f),'test_images.npy'))[:
|
125 |
-
labels = [np.load(os.path.join(os.path.join(corrupted_dir,f),'test_labels.npy'))[:
|
126 |
self.data = np.vstack(images)
|
127 |
self.labels = np.hstack(labels)
|
128 |
|
@@ -151,12 +149,6 @@ TRAIN_TRANSFORM = torchvision.transforms.Compose([
|
|
151 |
(0.1307,), (0.3081,))
|
152 |
])
|
153 |
|
154 |
-
'''
|
155 |
-
train_loader = torch.utils.data.DataLoader(
|
156 |
-
torchvision.datasets.MNIST('files/', train=True, download=True,
|
157 |
-
transform=TRAIN_TRANSFORM),
|
158 |
-
batch_size=batch_size_train, shuffle=True)
|
159 |
-
'''
|
160 |
|
161 |
test_loader = torch.utils.data.DataLoader(MNISTCorrupted(TRAIN_TRANSFORM),
|
162 |
batch_size=batch_size_test, shuffle=False)
|
@@ -409,7 +401,6 @@ def get_statistics():
|
|
409 |
|
410 |
|
411 |
def main():
|
412 |
-
#block = gr.Blocks(css=BLOCK_CSS)
|
413 |
block = gr.Blocks(css=BLOCK_CSS)
|
414 |
|
415 |
with block:
|
|
|
76 |
return img, label
|
77 |
|
78 |
class MNISTCorrupted_By_Digit(Dataset):
|
79 |
+
def __init__(self,transform,digit,limit=300):
|
80 |
self.transform = transform
|
81 |
self.digit = digit
|
82 |
corrupted_dir="./mnist_c"
|
|
|
114 |
|
115 |
|
116 |
|
|
|
|
|
117 |
class MNISTCorrupted(Dataset):
|
118 |
def __init__(self,transform):
|
119 |
self.transform = transform
|
120 |
corrupted_dir="./mnist_c"
|
121 |
files = [f.name for f in os.scandir(corrupted_dir)]
|
122 |
+
images = [np.load(os.path.join(os.path.join(corrupted_dir,f),'test_images.npy'))[:300] for f in files]
|
123 |
+
labels = [np.load(os.path.join(os.path.join(corrupted_dir,f),'test_labels.npy'))[:300] for f in files]
|
124 |
self.data = np.vstack(images)
|
125 |
self.labels = np.hstack(labels)
|
126 |
|
|
|
149 |
(0.1307,), (0.3081,))
|
150 |
])
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
test_loader = torch.utils.data.DataLoader(MNISTCorrupted(TRAIN_TRANSFORM),
|
154 |
batch_size=batch_size_test, shuffle=False)
|
|
|
401 |
|
402 |
|
403 |
def main():
|
|
|
404 |
block = gr.Blocks(css=BLOCK_CSS)
|
405 |
|
406 |
with block:
|
metrics.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"all": [10.55875015258789], "0": [0.0, 0.0], "1": [0.0, 0.0], "2": [0.0, 0.0], "3": [43.33333206176758, 100.0], "4": [86.66666412353516, 0.0], "5": [0.0, 0.0], "6": [0.0, 0.0], "7": [0.0, 0.0], "8": [0.0, 0.0], "9": [0.0, 0.0]}
|
|
|
|
model.pth
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e6fb83a68fe8dca1a7a9bc9db3029071edaf292ab2c3fda48ac3661579efe873
|
3 |
-
size 89871
|
|
|
|
|
|
|
|
optimizer.pth
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:29d01887c93ca1c9b69aee6ceb2f77c3c0db91936d5c13e92d5dfc7075bb2237
|
3 |
-
size 89807
|
|
|
|
|
|
|
|