Dynamic resources allocation has become even more attractive as a research direction with commodity computing gaining momentum and bringing new requirements regarding elasticity and flexibility and with the growing importance of cloud computing. The aim is to deliver high-performance computational while leveraging on other aspects, such as energy consumption. Admittedly, heterogeneity comes at the cost of greater design and management complexity. A promising approach to address the difficulties posed by this scenario is to exploit…

The Controller Area Network (CAN, also known as CAN Bus) is a vehicle bus standard designed to allow electronic control units and devices to communicate with each other in applications without a host computer. STM32F779-Eval board has 3 CAN interfaces, however only the two of them have their own clock (master). For that reason the following library provides some C methods to activate and use those CAN interfaces. Beware that each CAN interface requires its…

I have recently been playing with UART and DMA, although i’m still getting my head around it,. DMA allows you to transfer large amounts of data through the system without getting the processor core involved. Rather than the CPU laboriously reading a byte, the writing a byte from one buffer to another, you’d give the DMA controller a pointer to the start of a source buffer, a pointer to the start of the destination buffer,…

Are you in need of an additional memory larger than EEPROM? Although EEPROM is a very easy and effective way of storing data on the board, the built in EEPROM only offers only a few bytes of storage. When working with larger or more advanced projects we may need to store additional data so an external memory solution. For that reason, MicroSD card enables you to do this quickly and easily. The following library provides…

Backpropagation is one of the several ways in which an artificial neural network (ANN) can be trained. It is a supervised training scheme, which means, it learns from labeled training data. In simple terms, BackProp is like “learning from mistakes. “The supervisor corrects the ANN whenever it makes mistakes.” Initially, all the edge weights are randomly assigned. For every input in the training dataset, the ANN is activated, and its output is observed. This output…

In linear algebra, functional analysis, and related areas of mathematics, a norm (l-norms) is a function that assigns a strictly positive length or size to each vector in a vector space—save for the zero vector, which is assigned a length of zero. A seminorm, on the other hand, is allowed to assign zero length to some non-zero vectors (in addition to the zero vector). L1-Norm loss function is known as least absolute deviations (LAD). $latex…

An array $latex a $ is called beautiful if for every pair of numbers $latex a_i $, $latex a_j $, ($latex i \neq j $), there exists an $latex a_k $ such that $latex a_k = a_i * a_j $. Note that $latex k $ can be equal to $latex i $ or $latex j $ too. Input First line of the input contains an integer T denoting the number of test cases. T test cases…

The 3020 CNC router is a popular Chinese machine for a good reason. For around 500EUR, you can have a simple CNC with a rigid all-aluminum frame, three decent stepper motors, and pretty good resolution. However, a major disadvantage of this CNC is the out-of-date electronic parts. The motor controller is using a parallel port which is not available in any new computer(PC). For that reason, it is recommended to upgrade the motor controller to…

In a previous post we saw the differences between K-means and K-NN. Here is step by step on how to compute K-nearest neighbors KNN algorithm. Determine parameter K = number of nearest neighbors Calculate the distance between the query-instance and all the training samples Sort the distance and determine nearest neighbors based on the K-th minimum distance Gather the category of the nearest neighbors Use simple majority of the category of nearest neighbors as the prediction…

In short, the algorithms are trying to accomplish different goals. K-nearest neighbor is a subset of supervised learning classification (or regression) algorithms (it takes a bunch of labeled points and uses them to learn how to label other points). It is supervised because you are trying to classify a point based on the known classification of other points. In contrast, K-means is a subset of unsupervised learning clustering algorithms (it takes a bunch of unlabeled…

1. What is ICA ? Independent Component Analysis is a technique of separating signals from their linear mixes. We could assume two signals $ x_1(t) $ and $ x_2(t) $ that are a linear combination of two signals source $ s_1(t) $ and $ s_2(t) $, the relationships of $ x_n $ and $ s_n $ are shown in the following system of linear equations where $ a_{11} $, $ a_{12} $, $ a_{21} $ and…

Perceptron is one of the simplest forms of a neural network model. The following code snippet is a simple version of such a neural network using Matlab. Before using it please read some background information at wikipedia : https://en.wikipedia.org/wiki/Perceptron

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
clc; clear all; close all; % Data inputs=[1 0 0; 1 0 1;1 1 0;1 1 1]; % Desired Output desiredOutput=[1 1 1 0]; % Learning Rate learningRate=0.1; % HardLimit threshold threshold=0.5; % Initial Weights weights=[0 0 0]; for j=1:200 disp(sprintf('----- Round %d -----',j)); for i=1:size(inputs,1) c1=weights(1)*inputs(i,1); c2=weights(2)*inputs(i,2); c3=weights(3)*inputs(i,3); csum=c1+c2+c3; if(csum>threshold) output(i)=1; else output(i)=0; end error=desiredOutput(i)-output(i); correction= learningRate*error; weights(1)=weights(1)+inputs(i,1)*correction; weights(2)=weights(2)+inputs(i,2)*correction; weights(3)=weights(3)+inputs(i,3)*correction; disp(sprintf('Input [ %d %d %d ]\t\t DOut|COut [ %d ]|[ %d ]\t New Weights [ %1.1f %1.1f %1.1f ]' ,inputs(i,1),inputs(i,2),inputs(i,3) ,desiredOutput(i),output(i) ,weights(1),weights(2),weights(3))); end if isequal(output,desiredOutput)break;end end |