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/dynmlp.h | |
| parent | 4659574b206eda0178fb1d92a43c3e843c23ca36 (diff) | |
Reformat
Diffstat (limited to 'include/dynmlp.h')
| -rw-r--r-- | include/dynmlp.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/dynmlp.h b/include/dynmlp.h new file mode 100644 index 0000000..058271e --- /dev/null +++ b/include/dynmlp.h @@ -0,0 +1,24 @@ +#pragma once + +#include "utils.h" + +typedef struct { + int D; + int H; + int nparams; +} DynMLP; + +#define DYNMLP_W1(D, H) (0) +#define DYNMLP_b1(D, H) ((D + 1) * (H)) +#define DYNMLP_W2(D, H) ((D + 1) * (H) + (H)) +#define DYNMLP_b2(D, H) ((D + 1) * (H) + (H) + (H) * (D)) + +int dynmlp_nparams(int D, int H); +void dynmlp_init(DynMLP *net, int D, int H, double *theta, RNG *r); +void dynmlp_forward(const DynMLP *net, const double *theta, + const double *z, double t, double *out, + Workspace *ws); +void dynmlp_vjp(const DynMLP *net, const double *theta, + const double *z, double t, const double *v, + double *vjp_z, double *vjp_theta, + Workspace *ws); |