lava-nc / lava-dl

Deep Learning library for Lava
https://lava-nc.org
BSD 3-Clause "New" or "Revised" License
149 stars 71 forks source link

Regression Tutorial using slayer #282

Closed naveedunjum closed 7 months ago

naveedunjum commented 7 months ago

User story

As a user, I want to request some ways to solve regression problems using Slayer. I tried the xor_regression tutorial given and modifying that, by changing the dataloader for the dataset. But my outputs were always zero, and the network wasnt learning anything.

For example I wanted to recreate a sinusoidal function using Slayer, so I used a single dimension x axis to predict the corresponding sin value. But the outputs were always zero.

Can someone please help with dealing with outputs with continous functions?

Michaeljurado42 commented 7 months ago

I think there are a lot of ways to approach this. I recommend you look at the sigma delta tutorial here which predicts a continuous steering angle.

This is not the only way to get a continuous like value. For example, you can calculate spike rates over a sliding window. Then you can transform or interprete that rate however you want.

For example, If you introduce a bias term, you can constrain the output of the SNN to produce values between 0 and 1 with a sigmoid as shown in this demo.

naveedunjum commented 7 months ago

I think there are a lot of ways to approach this. I recommend you look at the sigma delta tutorial here which predicts a continuous steering angle.

This is not the only way to get a continuous like value. For example, you can calculate spike rates over a sliding window. Then you can transform or interprete that rate however you want.

For example, If you introduce a bias term, you can constrain the output of the SNN to produce values between 0 and 1 with a sigmoid as shown in this demo.

Thanks. I will have a look at this. I will post here how I far I can go with this