diff options
| author | y-jan137 <yousefjan24000@gmail.com> | 2026-03-18 09:56:29 +0300 |
|---|---|---|
| committer | y-jan137 <yousefjan24000@gmail.com> | 2026-03-18 09:56:29 +0300 |
| commit | 00cd5b38f26e40fbb0dd21e9682e9a9580fe3e78 (patch) | |
| tree | ad7000988a837bd3d141017e65cfa946f57a911d /include/adam.h | |
| parent | 4659574b206eda0178fb1d92a43c3e843c23ca36 (diff) | |
Reformat
Diffstat (limited to 'include/adam.h')
| -rw-r--r-- | include/adam.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/adam.h b/include/adam.h new file mode 100644 index 0000000..37f5767 --- /dev/null +++ b/include/adam.h @@ -0,0 +1,16 @@ +#pragma once + +typedef struct { + double *m; + double *v; + int nparams; + double lr; + double beta1; + double beta2; + double eps; + int t; +} Adam; + +Adam adam_init(int nparams, double lr, double beta1, double beta2, double eps); +void adam_update(Adam *a, double *theta, const double *grad); +void adam_free(Adam *a); |