forked from TensorStack-AI/TensorStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeliosOptions.cs
More file actions
65 lines (48 loc) · 2.15 KB
/
HeliosOptions.cs
File metadata and controls
65 lines (48 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace TensorStack.Python.Scheduler
{
public sealed record HeliosOptions : SchedulerOptions
{
public HeliosOptions() : base() { }
private HeliosOptions(HeliosOptions other) : base(other)
{
ShallowCopyProperties(other);
StageRange = other.StageRange?.ToList();
DisableCorrector = other.DisableCorrector?.ToList();
}
[JsonIgnore]
public override SchedulerType Scheduler => SchedulerType.Helios;
[JsonPropertyName("num_train_timesteps")]
public int NumTrainTimesteps { get; init; } = 1000;
[JsonPropertyName("shift")]
public float Shift { get; init; } = 1f;
[JsonPropertyName("stages")]
public int Stages { get; init; } = 3;
[JsonPropertyName("stage_range")]
public List<float> StageRange { get; init; } = [0f, 1.0f / 3.0f, 2.0f / 3.0f, 1f];
[JsonPropertyName("gamma")]
public float Gamma { get; set; } = 1f / 3f;
[JsonPropertyName("thresholding")]
public bool Thresholding { get; set; }
[JsonPropertyName("prediction_type")]
public PredictionType PredictionType { get; init; } = PredictionType.FlowPrediction;
[JsonPropertyName("solver_order")]
public int SolverOrder { get; init; } = 2;
[JsonPropertyName("predict_x0")]
public bool PredictX0 { get; set; } = true;
[JsonPropertyName("solver_type")]
public SolverType SolverType { get; set; } = SolverType.BH2;
[JsonPropertyName("lower_order_final")]
public bool LowerOrderFinal { get; set; } = true;
[JsonPropertyName("disable_corrector")]
public List<int> DisableCorrector { get; init; } = [];
[JsonPropertyName("use_flow_sigmas")]
public bool UseFlowSigmas { get; set; } = true;
[JsonPropertyName("use_dynamic_shifting")]
public bool UseDynamicShifting { get; init; } = false;
[JsonPropertyName("time_shift_type")]
public TimeShiftType TimeShiftType { get; set; } = TimeShiftType.Exponential;
}
}