Multilayer Perceptron

Download Example XORMultilayerPerceptron C# project

Multilayer Perceptron - Creation

Multilayer perceptron is a feed forward neural network that is trained through supervised learning and is used in classification of inputs into appropriate outputs. Multilayer perceptron is best thought of as a network of perceptrons separated into layers with each perceptron connected to all perceptrons in both neighboring layers. Perceptrons in the network, with the exception of input layer, use nonlinear activation function so that the multilayer perceptron can be used to solve problems where data is not linearly separable – for example XOR problem in provided sample code.

Read more

Multiclass Perceptron in C#

Download Multiclass Perceptron C# Project

In order to understand multiclass perceptron prior knowledge of binary perceptron is required.

Multiclass Perceptron is used for classifying input data into linearly separable classes. Each class in a multiclass perceptron has a separate set of input weights. Just like in a simple perceptron the inputs are multiplied by weights and then summed, but instead of score passing through an activation function the class with the highest score is chosen.


Multiclass Perceptron

Read more

Adding a parameter to a WPF control style

In this post I will demonstrate how to add a new parameter to a WPF control style without overriding the control parent class.

In particular I have created a custom button style that relies on the CornerRadius parameter to round any of the four corners of the button. Using this button style I have created a sample keypad shown below:

Read more

Thread Safe Event Dispatching in WPF

Recently I have been using a quite a bit of C# WPF on the projects I am developing because it provides for very flexible and quick user interface design and implementation. The learning curve for a traditional (C/C++) software developer may be steep, but once the basics are understood it is pretty easy to use as a development tool.

Since I develop applications that use external hardware (ex. Camera) I have to place some of the logic in threads in order not to block the user interface while an action is performed. After the action completes I need to pass the message back to the user interface. Unfortunately WPF user interface breaks if a user interface event is instantiated from a thread. Because of this I have created a class extender for EventHandler that makes thread instantiated events possible.

Read more

PictureBox Control Zoom

Recently I needed to implement zooming functionality using the mouse wheel in PictureBox control in C#.

My initial reflex was to reuse existing free code, but I kept on running into controls that were either too bulky or badly implemented. In the end I implemented a relatively simple class which can be used with the standard C# PictureBox.

One of the nicer functionalities of this implementation is that the point being scrolled under the cursor will stay in place during zooming in/out.

The heart of this class is the following function:

Read more

Manipulating CSV Spreadsheet Data – C#

Often times where I have been required to deal with the data stored in a humanly readable format. I have found that the easiest and the most portable way to deal with this data is via CSV files. This way the data can be reviewed or generated using OpenOffice Calc or Excel.

The code I am posting here does not deal with all eventualities of CSV but is a solid base to include into your own projects and expand as you see fit. As a side note I have posted this code on one of my favourite coding sites full of nerdy goodness
Read more