You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.sampling.mirostatesamplingpipeline.md 2.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # MirostateSamplingPipeline
  2. Namespace: LLama.Sampling
  3. A sampling pipeline which uses mirostat (v1) to select tokens
  4. ```csharp
  5. public class MirostateSamplingPipeline : BaseSamplingPipeline, ISamplingPipeline, System.IDisposable
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [BaseSamplingPipeline](./llama.sampling.basesamplingpipeline.md) → [MirostateSamplingPipeline](./llama.sampling.mirostatesamplingpipeline.md)<br>
  8. Implements [ISamplingPipeline](./llama.sampling.isamplingpipeline.md), [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable)
  9. ## Properties
  10. ### **Mu**
  11. Currently learned mu value
  12. ```csharp
  13. public float Mu { get; }
  14. ```
  15. #### Property Value
  16. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  17. ### **Tau**
  18. target entropy
  19. ```csharp
  20. public float Tau { get; set; }
  21. ```
  22. #### Property Value
  23. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  24. ### **Eta**
  25. learning rate
  26. ```csharp
  27. public float Eta { get; set; }
  28. ```
  29. #### Property Value
  30. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  31. ### **Grammar**
  32. Grammar to constrain valid tokens
  33. ```csharp
  34. public SafeLLamaGrammarHandle Grammar { get; set; }
  35. ```
  36. #### Property Value
  37. [SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)<br>
  38. ## Constructors
  39. ### **MirostateSamplingPipeline()**
  40. ```csharp
  41. public MirostateSamplingPipeline()
  42. ```
  43. ## Methods
  44. ### **ProcessLogits(SafeLLamaContextHandle, Span&lt;Single&gt;, ReadOnlySpan&lt;LLamaToken&gt;)**
  45. ```csharp
  46. protected void ProcessLogits(SafeLLamaContextHandle ctx, Span<float> logits, ReadOnlySpan<LLamaToken> lastTokens)
  47. ```
  48. #### Parameters
  49. `ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
  50. `logits` [Span&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.span-1)<br>
  51. `lastTokens` [ReadOnlySpan&lt;LLamaToken&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)<br>
  52. ### **ProcessTokenDataArray(SafeLLamaContextHandle, LLamaTokenDataArray, ReadOnlySpan&lt;LLamaToken&gt;)**
  53. ```csharp
  54. protected LLamaToken ProcessTokenDataArray(SafeLLamaContextHandle ctx, LLamaTokenDataArray candidates, ReadOnlySpan<LLamaToken> lastTokens)
  55. ```
  56. #### Parameters
  57. `ctx` [SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)<br>
  58. `candidates` [LLamaTokenDataArray](./llama.native.llamatokendataarray.md)<br>
  59. `lastTokens` [ReadOnlySpan&lt;LLamaToken&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.readonlyspan-1)<br>
  60. #### Returns
  61. [LLamaToken](./llama.native.llamatoken.md)<br>
  62. ### **Reset()**
  63. ```csharp
  64. public void Reset()
  65. ```
  66. ### **Clone()**
  67. ```csharp
  68. public ISamplingPipeline Clone()
  69. ```
  70. #### Returns
  71. [ISamplingPipeline](./llama.sampling.isamplingpipeline.md)<br>