Table of Contents

Class DistillationHyperParameters

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Distillation hyperparameters for tuning.

public record DistillationHyperParameters : IEquatable<DistillationHyperParameters>
Inheritance
DistillationHyperParameters
Implements
Inherited Members

Properties

AdapterSize

The size of the adapter. Can be 'small', 'medium', or 'large'.

[JsonPropertyName("adapterSize")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AdapterSize? AdapterSize { get; set; }

Property Value

AdapterSize?

BatchSize

Batch size for tuning. This feature is only available for open source models.

[JsonPropertyName("batchSize")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? BatchSize { get; set; }

Property Value

int?

EpochCount

Number of complete passes the model makes over the entire training dataset during training.

[JsonPropertyName("epochCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonConverter(typeof(StringToNullableLongConverter))]
public long? EpochCount { get; set; }

Property Value

long?

GenerationConfig

Generation config for Distillation teacher model sampling. Only the following fields are supported for distillation teacher samplings: - temperature - top_p - top_k - candidate_count - thinking_config

[JsonPropertyName("generationConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GenerationConfig? GenerationConfig { get; set; }

Property Value

GenerationConfig

LearningRate

The learning rate for distillation tuning.

[JsonPropertyName("learningRate")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? LearningRate { get; set; }

Property Value

double?

LearningRateMultiplier

Multiplier for adjusting the default learning rate.

[JsonPropertyName("learningRateMultiplier")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? LearningRateMultiplier { get; set; }

Property Value

double?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a DistillationHyperParameters object.

public static DistillationHyperParameters? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

DistillationHyperParameters

The deserialized DistillationHyperParameters object, or null if deserialization fails.