GradScaler<T>
Models & Types · AiDotNet.Tensors.Engines.Gpu
No summary documentation available yet.
Constructors
| Constructor |
Summary |
GradScaler(double initialScale) |
|
Properties
| Property |
Summary |
bool DynamicScaling { get; set; } |
|
bool FoundInfOrNan { get; } |
|
double BackoffFactor { get; set; } |
|
double GrowthFactor { get; set; } |
|
double InitialScale { get; } |
|
double MaxScale { get; set; } |
|
double MinScale { get; set; } |
|
double Scale { get; } |
|
int GrowthInterval { get; set; } |
|
Methods
| Method |
Summary |
T ScaleLoss(T loss) |
|
T UnscaleGradient(T gradient) |
|
Tensor<T> ScaleLoss(Tensor<T> loss, IEngine engine) |
|
bool DetectOverflow(Tensor<T> grad) |
|
bool DetectOverflow(Vector<T> grad) |
|
bool HasOverflow(T value) |
|
bool ShouldStep() |
|
bool UnscaleGradientsAndCheck(Tensor<T> grads) |
|
void Reset(double? newInitialScale) |
|
void Unscale(Tensor<T>[] gradients, IEngine engine) |
|
void Unscale(Vector<T>[] gradients) |
|
void Update() |
|