simulation.utils.machine_learning.data.image_pool module

Summary

Classes:

ImagePool

This class implements an image buffer that stores previously generated images.

Reference

class ImagePool(pool_size: int)[source]

Bases: object

This class implements an image buffer that stores previously generated images.

This buffer enables us to update discriminators using a history of generated images rather than the ones produced by the latest generators.

query(images: torch.Tensor) → torch.Tensor[source]

Return an image from the pool.

Returns images from the buffer.

By 50/100, the buffer will return input images. By 50/100, the buffer will return images previously stored in the buffer, and insert the current images to the buffer.

Parameters

images (torch.Tensor) – the latest generated images from the generator