Tuesday, March 28, 2017

Friday, March 10, 2017

Perceptron Challenge


As you finish the perceptron training, you have a new challenge to tackle - modifying the
perceptron code to classify a new data set. The information of the data set is listed in the following:
  1. No.of classes: 2 (class 0 and 1)
  2. No. of training data: 2000
  3. No. of testing data: 400
  4. No. of features: 3 (feature vector is in 3-dimensional space)
  5. Files: training.txt, and testing.txt
Since the original perceptron is only for 2-dimensional data, you need to identify and modify all the dimension-related code to make it work. After you finishing the classification, visualize your training and testing data, and the decision boundary using Grapher in Mac laptop (see example). Our deadline for this challenge is March 17, 2017 (Friday).

The Artificial Neural Network (ANN) presentations are available in the following:
  1. ANN 01 - Artificial Neurons
  2. ANN 02 - Perceptrons 
The Perceptron code can be found at the link.

Tuesday, February 14, 2017

MATLAB Serial Monitor

% MATLAB-Arduino Serial Port Monitor
clear
clc

% Defined Serial Port
serialPort = '/dev/cu.usbmodem1421';            % define COM port #

%Open Serial COM Port
s = serial(serialPort)
fopen(s);

delay = .01;                    % make sure sample faster than resolution

while 1 %Loop when Plot is Active
    dat = fscanf(s,'%f'); %Read Data from Serial as Float
 
    if(~isempty(dat) && isfloat(dat)) %Make sure Data Type is Correct       
        disp (dat);
    end
        
    %Allow MATLAB to Update Plot
    pause(delay);
end

%Close Serial COM Port and Delete useless Variables
fclose(s);
clear count dat delay s serialPort;