Table of Contents

Class SupervisedHyperParameters

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

Hyperparameters for SFT. This data type is not supported in Gemini API.

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

Properties

AdapterSize

Optional. Adapter size for tuning.

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

Property Value

AdapterSize?

BatchSize

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

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

Property Value

long?

EpochCount

Optional. 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?

LearningRate

Optional. Learning rate for tuning. Mutually exclusive with learning_rate_multiplier. This feature is only available for open source models.

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

Property Value

double?

LearningRateMultiplier

Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with learning_rate. This feature is only available for 1P models.

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

Property Value

double?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a SupervisedHyperParameters object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

SupervisedHyperParameters

The deserialized SupervisedHyperParameters object, or null if deserialization fails.