|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- # MirostateSamplingPipeline
-
- Namespace: LLama.Sampling
-
- A sampling pipeline which uses mirostat (v1) to select tokens
-
- ```csharp
- public class MirostateSamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable
- ```
-
- Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [BaseSamplingPipeline](./llama.sampling.basesamplingpipeline.md) → [MirostateSamplingPipeline](./llama.sampling.mirostatesamplingpipeline.md)<br>
- Implements [ISamplingPipeline](./llama.sampling.isamplingpipeline.md), [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
-
- ## Properties
-
- ### **Mu**
-
- Currently learned mu value
-
- ```csharp
- public float Mu { get; }
- ```
-
- #### Property Value
-
- [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- ### **Tau**
-
- target entropy
-
- ```csharp
- public float Tau { get; set; }
- ```
-
- #### Property Value
-
- [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- ### **Eta**
-
- learning rate
-
- ```csharp
- public float Eta { get; set; }
- ```
-
- #### Property Value
-
- [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
-
- ### **Grammar**
-
- Grammar to constrain valid tokens
-
- ```csharp
- public SafeLLamaGrammarHandle Grammar { get; set; }
- ```
-
- #### Property Value
-
- [SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)<br>
-
- ## Constructors
-
- ### **MirostateSamplingPipeline()**
-
- ```csharp
- public MirostateSamplingPipeline()
- ```
-
- ## Methods
-
- ### **ProcessLogits(SafeLLamaContextHandle, Span<Single>, ReadOnlySpan<LLamaToken>)**
-
- ```csharp
- protected void ProcessLogits(SafeLLamaContextHandle ctx, Span<float> logits, ReadOnlySpan<LLamaToken> lastTokens)
- ```
-
- #### Parameters
-
- `ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
-
- `logits` [Span<Single>](https://docs.microsoft.com/en-us/dotnet/api/system.span-1)<br>
-
- `lastTokens` [ReadOnlySpan<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)<br>
-
- ### **ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan<LLamaToken>)**
-
- ```csharp
- protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan<LLamaToken> lastTokens)
- ```
-
- #### Parameters
-
- `ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
-
- `candidates` [LLamaTokenDataArray](./llama.native.llamatokendataarray.md)<br>
-
- `lastTokens` [ReadOnlySpan<LLamaToken>](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)<br>
-
- #### Returns
-
- [LLamaToken](./llama.native.llamatoken.md)<br>
-
- ### **Reset()**
-
- ```csharp
- public void Reset()
- ```
-
- ### **Clone()**
-
- ```csharp
- public ISamplingPipeline Clone()
- ```
-
- #### Returns
-
- [ISamplingPipeline](./llama.sampling.isamplingpipeline.md)<br>
|