forked from TensorStack-AI/TensorStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPNDMOptions.cs
More file actions
49 lines (37 loc) · 1.59 KB
/
PNDMOptions.cs
File metadata and controls
49 lines (37 loc) · 1.59 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
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace TensorStack.Python.Scheduler
{
public sealed record PNDMOptions : SchedulerOptions
{
public PNDMOptions() : base() { }
private PNDMOptions(PNDMOptions other) : base(other)
{
ShallowCopyProperties(other);
TrainedBetas = other.TrainedBetas?.ToList();
}
[JsonIgnore]
public override SchedulerType Scheduler => SchedulerType.PNDM;
[JsonPropertyName("num_train_timesteps")]
public int NumTrainTimesteps { get; init; } = 1000;
[JsonPropertyName("beta_start")]
public float BetaStart { get; init; } = 0.00085f;
[JsonPropertyName("beta_end")]
public float BetaEnd { get; init; } = 0.012f;
[JsonPropertyName("beta_schedule")]
public BetaScheduleType BetaSchedule { get; init; } = BetaScheduleType.ScaledLinear;
[JsonPropertyName("trained_betas")]
public List<float> TrainedBetas { get; set; }
[JsonPropertyName("skip_prk_steps")]
public bool SkipPrkSteps { get; set; }
[JsonPropertyName("set_alpha_to_one")]
public bool SetAlphaToOne { get; set; }
[JsonPropertyName("prediction_type")]
public PredictionType PredictionType { get; init; } = PredictionType.Epsilon;
[JsonPropertyName("timestep_spacing")]
public TimestepSpacingType TimestepSpacing { get; init; } = TimestepSpacingType.Leading;
[JsonPropertyName("steps_offset")]
public int StepsOffset { get; init; } = 0;
}
}