top of page
Search

Blog #3 - My First Neural Network

  • hudsonaibel
  • Jul 20, 2023
  • 2 min read

Although I now have real IMU readings, I've decided that for my first network, I will use controlled data -- in this case, sine waves. I crafted 3 sine waves with artificial noise, for the x, y, and z. From here, I recorded the waves.

ree

Just like with the real data, I used pandas to save the data as a CSV. Then I parsed the data into two separate files, the input data, and the check data. The input data is a rolling window of 4 points, and the check data is the 5th point in the window. This allows me to feed in 4 points to the neural network and have it predict the 5th point.


ree

My Neural Network is composed of just 1 linear layer (so in reality this is barely a network). I put in my input of 12 points (4 points for each of the three axes), and make the output 3 points (the 5th prediction point for the three axes). After running through the data 1500 times, I managed to get a loss function of only 0.012. I successfully created my first neural network! To test how well it works, I created 3 new sine waves, with varying levels of noise and size, and ran the network again. This time I got a loss function of 0.693. While this is higher, it is still extremely high performing, especially with how much extra noise I added.


The next step is to create a Convolutional Neural Network (CNN for short). This is what the end project will use, so it will be important for me to get familiar with creating them. I'm also testing the best form of sending IMU data and am currently testing sending data over radio -- but that is a subject for another blog post.

ree







 
 
 

1 Comment


Owen Simon
Owen Simon
Jul 20, 2023

Wow Hudson!

Like
bottom of page