MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / reconstruct

Function reconstruct

cvae/main.py:57–63  ·  view source on GitHub ↗
(model, batch, out_file)

Source from the content-addressed store, hash-verified

55
56
57def reconstruct(model, batch, out_file):
58 # Reconstruct a single batch only
59 images = mx.array(batch["image"])
60 images_recon = model(images)[0]
61 paired_images = mx.stack([images, images_recon]).swapaxes(0, 1).flatten(0, 1)
62 grid_image = grid_image_from_batch(paired_images, num_rows=16)
63 grid_image.save(out_file)
64
65
66def generate(

Callers 1

mainFunction · 0.85

Calls 1

grid_image_from_batchFunction · 0.85

Tested by

no test coverage detected