Typo.
[pysvrt.git] / README.md
1 # Introduction #
2
3 This is the port of the Synthetic Visual Reasoning Test to the pytorch
4 framework.
5
6 The main function is
7
8 ```
9 torch.ByteTensor svrt.generate_vignettes(int problem_number, torch.LongTensor labels)
10 ```
11
12 where
13
14  * `problem_number` indicates which of the 23 problem to use
15  * `labels` indicates the boolean labels of the vignettes to generate
16
17 The returned ByteTensor has three dimensions:
18
19  * Vignette index
20  * Pixel row
21  * Pixel col
22
23 The two additional functions
24
25 ```
26 torch.ByteStorage svrt.compress(torch.ByteStorage x)
27 ```
28
29 and
30
31 ```
32 torch.ByteStorage svrt.uncompress(torch.ByteStorage x)
33 ```
34
35 provides a lossless compression scheme adapted to the ByteStorage of
36 the vignette ByteTensor (i.e. expecting a lot of 255s, a few 0s, and
37 no other value).
38
39 They allow to reduce the memory footprint by a factor ~50, and may be
40 usefull to deal with very large data-sets and avoid re-generating
41 images at every batch.
42
43 See vignette_set.py for a class CompressedVignetteSet using it.
44
45 # Installation and test #
46
47 Executing
48
49 ```
50 make -j -k
51 ./test-svrt.py
52 ```
53
54 should generate an image example.png in the current directory.
55
56 Note that the image generation does not take advantage of GPUs or
57 multi-core, and can be as fast as 10,000 vignettes per second and as
58 slow as 40 on a 4GHz i7-6700K.