MCPcopy Create free account

hub / github.com/Schlumberger/pixel-constrained-cnn-pytorch / functions

Functions64 in github.com/Schlumberger/pixel-constrained-cnn-pytorch

↓ 6 callersFunctiongated_activation
Applies a gated activation to the convolutional volume. Note that this activation divides the number of channels by 2. Parameters -------
pixconcnn/layers.py:378
↓ 6 callersMethodtrain
Trains model on the data given in data_loader. Parameters ---------- data_loader : torch.utils.data.DataLoader instance
pixconcnn/training.py:37
↓ 4 callersMethod__init__
(self, mask_type, *args, **kwargs)
pixconcnn/layers.py:57
↓ 4 callersFunctionget_conditional_pixels
Returns conditional pixels obtained from masking the data in batch with mask and appending the mask. E.g. if the input has size (N, C, H, W) t
utils/masks.py:440
↓ 4 callersMethodget_masks
Returns a tensor of shape (batch_size, 1, img_size[1], img_size[2]) containing masks which were generated according to mask_type and m
utils/masks.py:69
↓ 4 callersMethodsample
Generates samples from a GatedPixelCNN or GatedPixelCNNRGB. Parameters ---------- device : torch.device instance num
pixconcnn/models/gated_pixelcnn.py:19
↓ 3 callersFunctionbatch_random_mask
Returns a batch of random masks. Parameters ---------- img_size : see single_random_mask num_visibles : int or list of ints
utils/masks.py:143
↓ 3 callersFunctionsingle_random_mask
Returns random mask where 0 corresponds to a hidden value and 1 to a visible value. Shape of mask is same as img_size. Parameters -------
utils/masks.py:116
↓ 2 callersFunctionceleba
CelebA dataloader with square images. Note original CelebA images have shape (218, 178), this dataloader center crops these images to be (178, 178
utils/dataloaders.py:44
↓ 2 callersMethodforward
Forward method is implemented in child class (GatedPixelCNN or GatedPixelCNNRGB).
pixconcnn/models/gated_pixelcnn.py:14
↓ 2 callersMethodforward
x : torch.Tensor Image to predict logits for. x_cond : torch.Tensor Image containing pixels to be conditione
pixconcnn/models/pixel_constrained.py:24
↓ 2 callersFunctiongenerate_images
Generates image completions based on the images in batch masked by the masks in mask_descriptors. This will generate batch.size(0) * len(mask_
pixconcnn/generate.py:9
↓ 2 callersFunctionget_quantize_func
Returns a quantization function which can be used to set the number of colors in an image. Parameters ---------- num_colors : int
utils/dataloaders.py:127
↓ 2 callersFunctionget_repeated_conditional_pixels
Returns repeated conditional pixels. Parameters ---------- batch : torch.Tensor Shape (1, num_channels, width, height) mask
utils/masks.py:470
↓ 2 callersFunctioninitialize_model
Helper function that initializes an appropriate model based on the input arguments. Parameters ---------- img_size : tuple of ints
utils/init_models.py:6
↓ 2 callersFunctionmnist
MNIST dataloader with (28, 28) images. Parameters ---------- batch_size : int num_colors : int Number of colors to quantize
utils/dataloaders.py:7
↓ 1 callersMethod__init__
(self, img_size=(1, 32, 32), num_colors=256, num_filters=64, depth=17, filter_size=5)
pixconcnn/models/gated_pixelcnn.py:139
↓ 1 callersMethod_loss
(self, logits, batch)
pixconcnn/training.py:117
↓ 1 callersMethod_loss
(self, logits, prior_logits, cond_logits, batch)
pixconcnn/training.py:264
↓ 1 callersMethod_train_epoch
(self, data_loader)
pixconcnn/training.py:88
↓ 1 callersMethod_train_epoch
(self, data_loader)
pixconcnn/training.py:229
↓ 1 callersMethod_train_iteration
(self, batch)
pixconcnn/training.py:99
↓ 1 callersMethod_train_iteration
(self, batch, mask)
pixconcnn/training.py:240
↓ 1 callersFunctionbatch_bottom_mask
Masks all the output except the |num_rows| lowest rows (in the height dimension). Parameters ---------- img_size : see single_random_
utils/masks.py:179
↓ 1 callersFunctionbatch_center_mask
Masks all the output except the num_pixels by num_pixels central square of the image. Parameters ---------- img_size : see single_ran
utils/masks.py:217
↓ 1 callersFunctionbatch_edge_mask
Masks all the output except the num_pixels thick edge of the image. Parameters ---------- img_size : see single_random_mask num_pixe
utils/masks.py:242
↓ 1 callersFunctionbatch_left_mask
Masks all the pixels except the left side of the image. Parameters ---------- img_size : see single_random_mask num_cols : int
utils/masks.py:263
↓ 1 callersFunctionbatch_multi_random_blobs
Generates batch of masks with multiple random connected blobs.
utils/masks.py:431
↓ 1 callersFunctionbatch_random_rect_mask
Returns a batch of masks with random rectangles of visible pixels. Parameters ---------- img_size : see single_random_mask max_heigh
utils/masks.py:329
↓ 1 callersFunctionbatch_right_mask
Masks all the pixels except the right side of the image. Parameters ---------- img_size : see single_random_mask num_cols : int
utils/masks.py:281
↓ 1 callersFunctionbatch_top_mask
Masks all the output except the |num_rows| highest rows (in the height dimension). Parameters ---------- img_size : see single_random
utils/masks.py:198
↓ 1 callersFunctionload_model
Returns model, data_loader and mask_descriptor of trained model. Parameters ---------- directory : string Directory where ex
utils/loading.py:6
↓ 1 callersMethodlog_likelihood
Calculates log likelihood of samples under model. Parameters ---------- device : torch.device instance samples : tor
pixconcnn/models/gated_pixelcnn.py:73
↓ 1 callersMethodlog_likelihood
Calculates log likelihood of samples under model. Parameters ---------- samples : torch.Tensor Batch of images. S
pixconcnn/models/pixel_constrained.py:118
↓ 1 callersFunctionmulti_random_blobs
Generates masks with multiple random connected blobs. Parameters ---------- max_num_blobs : int Maximum number of blobs. Number o
utils/masks.py:405
↓ 1 callersFunctionprobs_and_conditional_plot
Creates a plot of pixel probabilities with the conditional pixels from the original image overlayed. Note this function only works for binary
utils/plots.py:6
↓ 1 callersFunctionrandom_blob
Generates masks with random connected blobs. Parameters ---------- img_size : see single_random_mask num_iter : int Number o
utils/masks.py:351
↓ 1 callersFunctionrandom_rect_mask
Returns a mask with a random rectangle of visible pixels. Parameters ---------- img_size : see single_random_mask max_height : int
utils/masks.py:299
↓ 1 callersMethodsample
Generate conditional samples from the model. The number of samples generated will be equal to the batch size of x_cond. Parameters
pixconcnn/models/pixel_constrained.py:42
↓ 1 callersFunctionuncertainty_plot
Sorts samples by their log likelihoods and creates an image representing the log likelihood of each sample as a box with color and size proportion
utils/plots.py:43
Method__getitem__
(self, idx)
utils/dataloaders.py:117
Method__init__
(self, path_to_data, subsample=1, transform=None)
utils/dataloaders.py:110
Method__init__
(self, img_size, mask_descriptor)
utils/masks.py:58
Method__init__
(self, in_channels, out_channels, kernel_size, stride, padding)
pixconcnn/layers.py:22
Method__init__
(self, mask_type, in_channels, out_channels, kernel_size, stride, padding, bias)
pixconcnn/layers.py:212
Method__init__
Gated PixelCNN convolutional block. Note the number of input and output channels must be the same, unless restricted is True. Paramet
pixconcnn/layers.py:234
Method__init__
Gated PixelCNN convolutional block for RGB images. Note the number of input and output channels must be the same, unless restricted is True.
pixconcnn/layers.py:299
Method__init__
(self, model, optimizer, device, record_loss_every=10, save_model_every=5)
pixconcnn/training.py:26
Method__init__
(self, model, optimizer, device, mask_generator, weight_cond_logits_loss=0., weight_prior_log
pixconcnn/training.py:152
Method__init__
(self, img_size=(2, 32, 32), num_colors=256, num_filters=32, depth=17, filter_size=5)
pixconcnn/models/cnn.py:30
Method__init__
(self, img_size=(3, 32, 32), num_colors=256, num_filters=64, depth=17, filter_size=5)
pixconcnn/models/gated_pixelcnn.py:212
Method__init__
(self, prior_net, cond_net)
pixconcnn/models/pixel_constrained.py:17
Method__len__
(self)
utils/dataloaders.py:114
Methodforward
(self, x)
pixconcnn/layers.py:41
Methodforward
(self, x)
pixconcnn/layers.py:183
Methodforward
(self, x)
pixconcnn/layers.py:226
Methodforward
(self, v_input, h_input)
pixconcnn/layers.py:281
Methodforward
(self, v_input, h_input)
pixconcnn/layers.py:350
Methodforward
(self, x)
pixconcnn/models/cnn.py:58
Methodforward
(self, x)
pixconcnn/models/gated_pixelcnn.py:173
Methodforward
(self, x)
pixconcnn/models/gated_pixelcnn.py:251
Functionquantize_func
Takes as input a float tensor with values in the 0 - 1 range and outputs a long tensor with integer values corresponding to each quant
utils/dataloaders.py:136
Methodsample_unconditional
Samples from prior model without conditioning.
pixconcnn/models/pixel_constrained.py:114
Methodtrain
Parameters ---------- data_loader : torch.utils.data.DataLoader instance epochs : int Number of epochs t
pixconcnn/training.py:167