X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=README.md;h=d0ec215a1767bd07bfc53b0e0758ce1891c39bd1;hb=77153ad6f6acb94a5132e9930722500cd93a6960;hp=4efe67fbc4538875228fdacddbb3ab38c3c9e113;hpb=f2da660a51ed51cab4d81df29109e26e0da347bc;p=pysvrt.git diff --git a/README.md b/README.md index 4efe67f..d0ec215 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,6 @@ This is a port of the Synthetic Visual Reasoning Test problems to the pytorch framework, with an implementation of two convolutional networks to solve them. -The main function is - -``` -torch.ByteTensor svrt.generate_vignettes(int problem_number, torch.LongTensor labels) -``` - -where - - * `problem_number` indicates which of the 23 problem to use - * `labels` indicates the boolean labels of the vignettes to generate - -The returned ByteTensor has three dimensions: - - * Vignette index - * Pixel row - * Pixel col - # Installation and test # Executing @@ -36,7 +19,41 @@ Note that the image generation does not take advantage of GPUs or multi-core, and can be as fast as 10,000 vignettes per second and as slow as 40 on a 4GHz i7-6700K. -# Vignette compression # +# Vignette generation and compression # + +## Vignette sets ## + +The svrtset.py implements the classes `VignetteSet` and +`CompressedVignetteSet` with the following constructor + +``` +__init__(problem_number, nb_samples, batch_size, cuda = False, logger = None) +``` + +and the following method to return one batch + +``` +(torch.FloatTensor, torch.LongTensor) get_batch(b) +``` + +## Low-level functions ## + +The main function for genering vignettes is + +``` +torch.ByteTensor svrt.generate_vignettes(int problem_number, torch.LongTensor labels) +``` + +where + + * `problem_number` indicates which of the 23 problem to use + * `labels` indicates the boolean labels of the vignettes to generate + +The returned ByteTensor has three dimensions: + + * Vignette index + * Pixel row + * Pixel col The two additional functions