projects
/
pysvrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed the network structure to Afroze's ShallowNet.
[pysvrt.git]
/
test-svrt.py
diff --git
a/test-svrt.py
b/test-svrt.py
index
6b5f826
..
5c16069
100755
(executable)
--- a/
test-svrt.py
+++ b/
test-svrt.py
@@
-34,12
+34,17
@@
from torch.nn import functional as fn
from torchvision import datasets, transforms, utils
from torchvision import datasets, transforms, utils
-
from _ext
import svrt
+import svrt
-train_set = svrt.generate_vignettes(12, 64)
+labels = torch.LongTensor(12).zero_()
+labels.narrow(0, 0, labels.size(0)//2).fill_(1)
-
print(str(type(train_set)), train_set.size()
)
+
x = svrt.generate_vignettes(4, labels
)
-
train_set.div_(255
)
+
x = x.view(x.size(0), 1, x.size(1), x.size(2)
)
-torchvision.utils.save_image(train_set.view(train_set.size(0), 1, train_set.size(1), train_set.size(2)), 'example.png')
+x.div_(255)
+
+torchvision.utils.save_image(x, 'example.png')
+
+print('Wrote example.png')