liveBook · Manning

Generate

A generate function is an API operation that produces model-generated outputs from specified inputs during inference.

How 2 Manning books explain it

Deep Learning with R, Third Edition

generate() is a text-generation method that extends a prompt with tokens sampled according to a configured generation strategy.

How it is used
Generates prompt continuations or model outputs, supporting text sampling and epoch-end image visualization.
How deep it goes
Demonstrates prompting, greedy sampling, max_length, and callback integration, but defers generation internals and sampling details.
Examples
Uses Gemma continuations for advice, brownies, and a factual question, plus a callback that displays generated image grids.
What you can do after
Apply it via KerasHub to generate bounded text continuations or integrate image generation into an epoch-end callback.

Read how Deep Learning with R, Third Edition explains generate →

Build a Large Language Model (From Scratch)

A function used to produce model outputs from input prompts by running generation over a fine-tuned language model.

How it is used
Generates and collects responses from an instruction-fine-tuned language model for manual comparison and evaluation.
How deep it goes
Shows call arguments, decoding, prompt slicing, and response storage, but does not detail the generation algorithm internally.
Examples
Uses instruction prompts, decoded model responses, a three-entry comparison, and a full test-set JSON export.
What you can do after
Apply it via generate calls to produce, decode, compare, and save instruction-following model responses.

Read how Build a Large Language Model (From Scratch) explains generate →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.