tf2rl.tools package

Submodules

tf2rl.tools.img_tools module

tf2rl.tools.img_tools.random_crop(input_imgs, output_size)
Parameters
  • input_imgs – np.ndarray Images whose shape is (batch_size, width, height, channels)

  • output_size – Int Output width and height size.

Returns:

tf2rl.tools.img_tools.center_crop(img, output_size)
Parameters
  • img – np.ndarray Input image array. The shape is (width, height, channel)

  • output_size – int Width and height size for output image

Returns:

tf2rl.tools.img_tools.preprocess_img(img, bits=5)

Preprocessing image, see https://arxiv.org/abs/1807.03039.

tf2rl.tools.vae module

class tf2rl.tools.vae.VAE(*args, **kwargs)

Bases: tensorflow.python.keras.engine.training.Model

__init__(latent_dim, inference_net, generative_net)
sample(eps=None)
encode(x)
reparameterize(mean, logvar)
decode(z, apply_sigmoid=False)
compute_loss(x)
compute_apply_gradients(x)
tf2rl.tools.vae.log_normal_pdf(sample, mean, logvar, raxis=1)

Module contents