diff options
| author | Your Name <[email protected]> | 2026-07-30 14:21:42 -0700 |
|---|---|---|
| committer | Your Name <[email protected]> | 2026-07-30 14:21:42 -0700 |
| commit | 1217fb762ea1b5b4818ac2627f65b34b88b34ebd (patch) | |
| tree | 0cb69ab27353ebe93bac7b62c0238b8f9a20772a | |
| parent | d016db5ce883778042b1c97b6f3d3dde088e801b (diff) | |
More complex sin wave prediction
| -rwxr-xr-x | bin/benchmark | bin | 263664 -> 263760 bytes | |||
| -rw-r--r-- | build/main.o | bin | 29664 -> 30472 bytes | |||
| -rw-r--r-- | src/main.c | 11 |
3 files changed, 8 insertions, 3 deletions
diff --git a/bin/benchmark b/bin/benchmark Binary files differindex 18fdde5..b4de420 100755 --- a/bin/benchmark +++ b/bin/benchmark diff --git a/build/main.o b/build/main.o Binary files differindex 67ae072..e2959f0 100644 --- a/build/main.o +++ b/build/main.o @@ -64,8 +64,10 @@ int main(void) double training_inputs[NUM_TRAINING_STEPS * NUM_INPUTS]; for (size_t timestep = 0; timestep < NUM_TRAINING_STEPS; timestep++) { for (size_t input = 0; input < NUM_INPUTS; input++) { - training_inputs[timestep * NUM_INPUTS + input] = - sin(2.0 * PI * (double)timestep / 50.0); + double signal = + 0.7 * sin(2.0 * PI * (double)timestep / 50.0) + + 0.3 * sin(2.0 * PI * (double)timestep / 17.0); + training_inputs[timestep * NUM_INPUTS + input] = signal; } } @@ -73,7 +75,10 @@ int main(void) double target_outputs[NUM_TRAINING_STEPS * NUM_OUTPUTS]; for (size_t timestep = 0; timestep < NUM_TRAINING_STEPS; timestep++) { size_t next_timestep = (timestep + 1) % NUM_TRAINING_STEPS; - double target = sin(2.0 * PI * (double)next_timestep / 50.0); + + double target = + 0.7 * sin(2.0 * PI * (double)next_timestep / 50.0) + + 0.3 * sin(2.0 * PI * (double)next_timestep / 17.0); for (size_t output = 0; output < NUM_OUTPUTS; output++) { target_outputs[timestep * NUM_OUTPUTS + output] = target; |
