Skip to main content
. 2022 Apr 15;8(4):113. doi: 10.3390/jimaging8040113
Algorithm 1 Adam
Input: s0—initial solution, η, β1, β2—learning step sizes,  f
1. set iteration number t to 0
2. initialize the c0 and v0 tensors filled with zeros
3. set ϵ=10−8
4. while the stop condition is not met do:
5. t=t+1
6. ct=β1×ct−1+(1−β1)×∇f(st−1)
7. vt=vt−1−(1−β2)×(vt−1−∇f2(st−1))
8. st=η×ct×(vt+ϵ)−1
9. end loop
10. return st