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

Image separation of mixed and overlapped images is a frequent problem in computer vision (image processing). The following Matlab source code is a demonstration of image separation using FastICA algorithm based on kurtosis.

TiIf a program requires measuring elapsed time, you will need an individual timer that will be independent even if the user changes the time on the system clock. In Linux there are several different implementations for different cases (https://linux.die.net/man/3/clock_gettime): CLOCK_REALTIME System-wide realtime clock. Setting this clock requires appropriate privileges. CLOCK_MONOTONIC Clock that cannot be set and represents monotonic time since some unspecified starting point. CLOCK_PROCESS_CPUTIME_ID High-resolution per-process timer from the CPU. CLOCK_THREAD_CPUTIME_ID Thread-specific CPU-time clock.…

The aim of this article is to detect the edges with a given direction in an image. To that end create a function [ E ] = oriented_edges( I, thr, a, da ) that takes as input a double grayscale image Ι, a threshold value thr, a direction a, and an angle da. The output of the function is a binary image Ε where the pixels that meet the following requirements should have the value 1:…

PCA is a way of identifying patterns in data, and expressing the data in such a way as to highlight their similarities and differences. Below are the steps of the algorithm:

Step 1 – Initialize the dataset, 6 vectors of 32 sample data

Step 2 – Subtract the mean from each of the data dimensions. The mean subtracted is the average across each dimension. [math]Y= X – (O * Mean(X)) [/math], where [math]O…