Enum RandomSampling.RandomSamplers
- Namespace
- LMKit.TextGeneration.Sampling
- Assembly
- LM-Kit.NET.dll
Provides a comprehensive overview of the assortment of samplers available for implementation within the RandomSampling strategy, each offering unique selection mechanisms.
public enum RandomSampling.RandomSamplers
Fields
TopK = 0Selects the top K predictions.
TailFree = 1Reduces the influence of tail-end predictions.
LocallyTypical = 2Focuses on selections that are typical within a local context.
TopP = 3Selects predictions that cumulatively reach a probability threshold.
MinP = 4Filters out predictions below a certain probability threshold.
Temperature = 5Adjusts the probability distribution based on a temperature parameter to control the randomness of selection.
Examples
The following example shows how to customize the sampler execution order:
using LMKit.TextGeneration.Sampling;
var sampling = new RandomSampling
{
Temperature = 0.7f,
// Apply temperature scaling first, then filter by TopK and TopP.
SamplersSequence = new[]
{
RandomSampling.RandomSamplers.Temperature,
RandomSampling.RandomSamplers.TopK,
RandomSampling.RandomSamplers.TopP
}
};