attractivechaos / kann

A lightweight C library for artificial neural networks
Other
684 stars 116 forks source link

Getting Started example not working on macOS 11.3, Apple M1 chip #44

Open dariosanfilippo opened 3 years ago

dariosanfilippo commented 3 years ago

Hello, people.

I just wanted to let you know that at least the Getting Started example doesn't seem to be working on macOS 11.3, Apple M1 chip, whereas it works correctly on my old machine, which is an Intel Macbook Pro running macOS 10.15.7.

If I print the size of int, float, and double types, I get the same results on both machines (4, 4, and 8).

This is the output when I try running the Getting Started example on BigSur:

dariosanfilippo@Darios-MBP kann % seq 30000 | awk -v m=10000 '{a=int(m*rand());b=int(m*rand());print a,b,a+b}' \
  | ./examples/rnn-bit -m7 -o add.kan -
epoch: 1; cost: 0.0587254 (class error: 2.59%)
epoch: 2; cost: 0.000135723 (class error: 0.00%)
epoch: 3; cost: 7.7552e-05 (class error: 0.00%)
epoch: 4; cost: 4.28615e-05 (class error: 0.00%)
epoch: 5; cost: 4.24452e-05 (class error: 0.00%)
epoch: 6; cost: 2.26656e-05 (class error: 0.00%)
epoch: 7; cost: 1.84629e-05 (class error: 0.00%)
dariosanfilippo@Darios-MBP kann % echo 400958 737471 | ./examples/rnn-bit -Ai add.kan -
1924146487037

Would you know what the issue might be?

Thank you so much for your help.

Dario