Divooka Reference

Fine Tune Settings

14 nodes

On this page 14

Make Fine Tune Settings

Function

Settings for a LoRA or QLoRA fine-tune.

Signature
FineTuneSettings -> Fine Tune Settings
    rank: Integer
    alpha: Number
    dropout: Number
    learningRate: Number
    epochs: Number
    maxSteps: Integer
    batchSize: Integer
    gradientAccumulation: Integer
    maxLength: Integer
    fourBit: Truth
    device: Compute Device
    seed: Integer
FineTuneSettings FineTuneSettings(
    int rank = 16,
    double alpha = 32,
    double dropout = 0.05,
    double learningRate = 0.0002,
    double epochs = 1,
    int maxSteps = 0,
    int batchSize = 4,
    int gradientAccumulation = 1,
    int maxLength = 512,
    bool fourBit = false,
    ComputeDevice device = ComputeDevice.Auto,
    int seed = 42)

Parameters

nametypedefaultdescription
rankInteger16The adapter's rank: larger learns more and saves a bigger file; 8 to 64 is usual.
alphaNumber32How strongly the adapter applies; usually twice the rank.
dropoutNumber0.05The share of the adapter's inputs dropped while training, against overfitting.
learningRateNumber0.0002How big each step is; 1e-4 to 3e-4 suits LoRA.
epochsNumber1How many times to go through the data.
maxStepsInteger0Stop after this many steps whatever the epochs say; 0 for no limit.
batchSizeInteger4How many examples each step sees at once.
gradientAccumulationInteger1How many batches add up to one step, for a larger effective batch in the same memory.
maxLengthInteger512Examples longer than this many tokens are cut.
fourBitTruthFalseQLoRA: hold the base model in 4-bit NF4 while training, a quarter of the memory; on a GPU.
deviceCompute DeviceAutoWhere it trains.
seedInteger42Makes the run repeatable: the adapter's start, the shuffling and the dropout.

Returns

resultFine Tune Settings
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Alpha

Function

How strongly the adapter applies.

Signature
Alpha(Fine Tune Settings: Fine Tune Settings) -> Number
double Alpha(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Batch Size

Function

Examples per batch.

Signature
BatchSize(Fine Tune Settings: Fine Tune Settings) -> Integer
int BatchSize(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Device

Function

Where it trains.

Signature
Device(Fine Tune Settings: Fine Tune Settings) -> Compute Device
ComputeDevice Device(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultCompute Device
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Dropout

Function

The adapter's dropout.

Signature
Dropout(Fine Tune Settings: Fine Tune Settings) -> Number
double Dropout(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Epochs

Function

Passes over the data.

Signature
Epochs(Fine Tune Settings: Fine Tune Settings) -> Number
double Epochs(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Four Bit

Function

Whether the base model is held in 4-bit (QLoRA).

Signature
FourBit(Fine Tune Settings: Fine Tune Settings) -> Truth
bool FourBit(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultTruth
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Gradient Accumulation

Function

Batches per step.

Signature
GradientAccumulation(Fine Tune Settings: Fine Tune Settings) -> Integer
int GradientAccumulation(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Learning Rate

Function

The learning rate.

Signature
LearningRate(Fine Tune Settings: Fine Tune Settings) -> Number
double LearningRate(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Max Length

Function

The longest example, in tokens.

Signature
MaxLength(Fine Tune Settings: Fine Tune Settings) -> Integer
int MaxLength(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Max Steps

Function

The step limit; 0 for none.

Signature
MaxSteps(Fine Tune Settings: Fine Tune Settings) -> Integer
int MaxSteps(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Rank

Function

The adapter's rank.

Signature
Rank(Fine Tune Settings: Fine Tune Settings) -> Integer
int Rank(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

Seed

Function

The seed.

Signature
Seed(Fine Tune Settings: Fine Tune Settings) -> Integer
int Seed(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning

To String

Function

One line, as a preview shows it.

Signature
ToString(Fine Tune Settings: Fine Tune Settings) -> Text
string ToString(FineTuneSettings Fine Tune Settings)

Parameters

nametypedefaultdescription
Fine Tune SettingsFine Tune Settings—

Returns

resultText
Ships with
Divooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Fine Tune Settings
Package
Machine Learning