Go Down

Topic: NN on arduino duo board (Read 1 time) previous topic - next topic

himsikha

Hi,

I am trying to explore to run neural network models on arduino due board.I have tried running back propagation algorithm from the below site:
http://robotics.hobbizine.com/arduinoann.html

I was wandering is it possible to do more something like some kind of prediction on the board without training the model on the board ?

Please suggest me if any kind of stuff i can try,

Thank you .

pylon

Quote
I was wandering is it possible to do more something like some kind of prediction on the board without training the model on the board ?
If you have learning data on the PC you can do the training there and load the data on the Arduino. There no need to do the training on the Arduino but often the training data is not available elsewhere.

himsikha

okay, i got the point.
thank you so much.

himsikha

#3
Feb 21, 2018, 11:32 am Last Edit: Feb 21, 2018, 11:42 am by himsikha
If you have learning data on the PC you can do the training there and load the data on the Arduino. There no need to do the training on the Arduino but often the training data is not available elsewhere.
Hi,

I have trained the mnist model in PC and have hard coded the hidden weights and output weights in the code in arduino ide . I am using 3 layer network (inp=784,hidden=15 and output =10) to recognize the mnist dataset.

But i am not able to get the correct outputs. Any suggestions regarding this?PLz guide me how can i  predict digits in arduino duo micro controller using 3 layer feed forward network?

pylon

If you use the same code on your PC you don't get the same results? Post your code!

himsikha

If you use the same code on your PC you don't get the same results? Post your code!
its working now..thank you so much for your response

himsikha

#6
Mar 08, 2018, 09:57 am Last Edit: Mar 08, 2018, 10:20 am by himsikha
Hi,

How can we read pixel values of a image from my PC to arduino?Is it possible from load an image(.jpeg format) from the system to arduino?Is there any library available other than TFT and SD libray?
Plz guide me regarding this.
Thank you.

ard_newbie


himsikha

Okay,thank you for your response.I will go through it.

himsikha

Actually.I need to read the pixel intensities of  an image  stored in my system onto arduino .Is it possible without an SD card?

MorganS

So send the data to the Arduino on Serial. Decode the JPG or BMP on the PC and send the individual pixels. It will be slow so only very small images are practical. Start with something smaller than 64x64.
"The problem is in the code you didn't post."

himsikha


himsikha

#include <SPI.h>
#include <SD.h>
#include <TFT.h>
//#include <stdio.h>
//File bmpImage;
File textFile;
int height,width;
File bmpImage;

void setup() {
 Serial.begin (9600);
  // Open
//bmpImage = SD.open("/u/snpe-1.2.2/models/mnist/data/Ex0.jpg", FILE_READ);
bmpImage = SD.open("/home/ee210201/Documents/7.march/img.bmp",FILE_READ);
textFile = SD.open("/u/test.txt", FILE_WRITE);
bmpImage.seek(0x1C);// width in pixel = 28
width = bmpImage.read();
bmpImage.seek(0x1C);// height in pixel = 28
height = bmpImage.read();
Serial.println(width);
Serial.println(height);
int imageSize = height*width;

//bmpImage.seek(0x36);//skip bitmap header

for(int i = 0; i < height; i ++) {
  for (int j = 0; j < width; j ++) {
    textFile.write(bmpImage.read());
    textFile.write(" ");
  }
  textFile.write("\n");
}

bmpImage.close();
textFile.close();




Serial.println("done write");

}

void loop()
{
 

}

himsikha

Hi,

I wanted to measure the %CPU USAGE on arduino? Is there any tool to check it?


ard_newbie

#14
Mar 15, 2018, 06:59 am Last Edit: Mar 15, 2018, 07:44 am by ard_newbie
A tutorial for measuring CPU utilization with code (for AVR) you could easily adapt for a DUE:

https://spin.atomicobject.com/2012/05/02/measuring-cpu-utilization/

There is an Atmel Application Note on this subject which might help you:
http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42627-CPU-Usage-Demonstration-Using-DMAC-of-SAML22_ApplicationNote_AT10843.pdf

Go Up