ONE - On-device Neural Engine
Loading...
Searching...
No Matches
adam.py
Go to the documentation of this file.
1from typing import Literal
2from .optimizer import Optimizer
3
4
6 """
7 Adam optimizer.
8 """
9 def __init__(self,
10 learning_rate: float = 0.001,
11 beta1: float = 0.9,
12 beta2: float = 0.999,
13 epsilon: float = 1e-7) -> None:
14 """
15 Initialize the Adam optimizer.
16
17 Args:
18 learning_rate (float): The learning rate for optimization.
19 beta1 (float): Exponential decay rate for the first moment estimates.
20 beta2 (float): Exponential decay rate for the second moment estimates.
21 epsilon (float): Small constant to prevent division by zero.
22 """
23 super().__init__(learning_rate)
24 self.beta1: float = beta1
25 self.beta2: float = beta2
26 self.epsilon: float = epsilon
None __init__(self, float learning_rate=0.001, float beta1=0.9, float beta2=0.999, float epsilon=1e-7)
Definition adam.py:13