Python module
sampling
Sampling custom ops.
MinPSampler
class max.nn.sampling.MinPSampler(dtype, shape, temperature=1)
A min_p sampler.
dtype
dtype: DType
min_p
min_p: float
shape
shape: Shape
temperature
temperature: float
RejectionSampler
class max.nn.sampling.RejectionSampler(device, top_k=1, top_p=1, temperature=1.0, seed=0, eps=1e-05)
A simple rejection sampler.
RejectionSamplerWithResiduals
class max.nn.sampling.RejectionSamplerWithResiduals(device, top_k=1, temperature=1.0, eps=1e-10, seed=0, debug=False)
A simple rejection sampler.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!