Purpose: How to train an MLP neural network in MATLAB environment!

Similar documents
Implementation of Parma Polyhedron Library -functions in MATLAB

USING LAPACK SOLVERS FOR STRUCTURED MATRICES WITHIN MATLAB

Part #10. AE0B17MTB Matlab. Miloslav Čapek Viktor Adler, Pavel Valtr, Filip Kozák

Still More About Matlab GUI s (v. 1.3) Popup Menus. Popup Menu Exercise. Still More GUI Info - GE /29/2012. Copyright C. S. Tritt, Ph.D.

How to get Real Time Data into Matlab

Term Project report for EE5302

Wir schaffen Wissen heute für morgen

The Language of Technical Computing. Computation. Visualization. Programming. Creating Graphical User Interfaces Version 1

ECE 662 Spring 2008 Homework #2

MATLAB for biologists Lecture 6

Introduction to Matlab/Octave

A System for Interfacing MATLAB with External Software Geared Toward Automatic Differentiation

SBT 645 Introduction to Scientific Computing in Sports Science #5

Face Recognition. Programming Project. Haofu Liao, BSEE. Department of Electrical and Computer Engineering. Northeastern University.

3D Visualization for Matlab

Computational Methods of Scientific Programming

Master Thesis Accelerating Image Registration on GPUs

There are two ways to launch Graphical User Interface (GUI). You can either

Widgets. Widgets Widget Toolkits. User Interface Widget

Building a Graphical User Interface

LEARNING TO PROGRAM WITH MATLAB. Building GUI Tools. Wiley. University of Notre Dame. Craig S. Lent Department of Electrical Engineering

APPENDIX. Source code. Part 1. Part 2. Part 3.

Computational Methods of Scientific Programming. Matlab Lecture 3 Lecturers Thomas A Herring Chris Hill

Python Scripting for Computational Science

Widgets. Widgets Widget Toolkits. 2.3 Widgets 1

USB-IO MATLAB. Gerox(c) 5/30/2003 USB-IO HID USB-IO HID USB IO. usbg.dll STEP.1 DOS. main STEP.2. STEP.3 main.

Python Scripting for Computational Science

D. Bindel. March 4, 2009

Graphical User Interface. GUI in MATLAB. Eng. Banan Ahmad Allaqta

MATLAB. The Language of Technical Computing. MATLAB Graphics Reference Version 5.1. Computation. Visualization. Programming

Tim Love. July 24, Introduction 2. 2 Info and help commands 2

TxWin 5.xx Programming and User Guide

Assignment #4: Scalar Field Visualization 3D: Cutting Plane, Wireframe Iso-surfacing

Using Visual Basic Studio 2008

BUILDING A MATLAB GUI. Education Transfer Plan Seyyed Khandani, Ph.D. IISME 2014

Class object initialization block destructor Class object

Interaction Design. Heuristic Evaluation & Cognitive Walkthrough

Microsoft Excel 2007

Getting Familiar with Microsoft Word 2010 for Windows

Microsoft Excel 2010 Level 1

Special Topics II: Graphical User Interfaces (GUIs)

Getting Started with. Microsoft Office 2010

COMMON QUARTERLY EXAMINATION SEPTEMBER 2018

Table of Contents Welcome to Menu.Applet... 2 Why Java -based menus?... 2 Basic terminology... 2 Getting to know Menu.Applet... 4 Creating a new menu

Query Based Reports in Maximo. Overview of Maximo Ad-hoc reporting functionality

What is interaction? communication user system. communication between the user and the system

Definiens. Tissue Studio 4.2. Tutorial 3: Metadata Import, Manual ROI Selection and Vessel Detection

SCRIPTO. A New Tool for Customizing LS-PREPOST

THE FLORIDA STATE UNIVERSITY COLLEGE OF ARTS AND SCIENCES INTERNET COMPUTING WITH MATLAB ARTHI GOKARN

IBM Rational Rhapsody Gateway Add On. User Guide

USING THE SYSTEM-C LIBRARY FOR BIT TRUE SIMULATIONS IN MATLAB

Add notes to a document

All Applications Release Bulletin January 2010

Miami s Quick Start Guide for Using. Snap 9 Professional. to Create a Paper Keyed Survey. Miami s Survey Solutions

plfgi MatLAB Interface for PixeLINK FireWire Cameras User Manual & Technical Guide

Scilab as an alternative for Matlab

Functions in C C Programming and Software Tools

How to build MPTK with CMake SUMMARY

MATRIX INVERSION SPEED UP WITH CUDA JORGE SORIANO PINEDO ELECTRICAL AND COMPUTER ENGINEERING

CNBC Matlab Mini-Course

Microsoft Excel 2016 Level 1

ARIA and Matlab Integration With Applications

CS 354R: Computer Game Technology

Starting Microsoft Visual Studio 6.0 And Exploring Available Controls Tools

JScript Reference. Contents

Matlab Tutorial Jun. Prof. Matthias Hein

Visual Basic Primer A. A. Cousins

Customizing DAZ Studio

MDA V8.1 What s New Functionality Overview

Lecture 11 Usability of Graphical User Interfaces

Control Abstraction. Hwansoo Han

IBM Rational Rhapsody Gateway Add On. User Manual

Visual Basic.NET. 1. Which language is not a true object-oriented programming language?

Review: Event Driven Programming & GUI. CSCE155N Matlab Fall 2016

Table of Contents Lesson 1: Introduction to the New Interface... 2 Lesson 2: Prepare to Work with Office

Mastering EA Document Style Sheets

MDA 8 preview SP3 What s New Functionality Overview

WebVisit User course

Data Abstraction. Hwansoo Han

INDUSTRIAL COMMUNICATION BETWEEN MATLAB AND THE ETHERCAT FIELDBUS

CS 4300 Computer Graphics

A demo Wakanda solution (containing a project) is provided with each chapter. To run a demo:

From Image to Video: Real-time Medical Imaging with MRI

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ User Interfaces. Emina Torlak

MATLAB. Creating Graphical User Interfaces Version 7. The Language of Technical Computing

System Design S.CS301

CSc 520 Principles of Programming Languages

Teamcenter 11.1 Systems Engineering and Requirements Management

Functions in C C Programming and Software Tools. N.C. State Department of Computer Science

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, November 2017

CSc 520 Principles of Programming Languages. ameter Passing Reference Parameter. Call-by-Value Parameters. 28 : Control Structures Parameters

Windows and Events. created originally by Brian Bailey

Electrical System Functional Definition

Syntax-Directed Translation Part I

PUTTING IT TOGETHER: A STREAMING VIDEO APPLICATION C6701 EVM, HPI, MATLAB, andmex-files

Contents. Foreword. Examples of GeoGebra Applet Construction 1 A Straight Line Graph... 1 A Quadratic Graph... 6 The Scalar Product...

CS 3305 Intro to Threads. Lecture 6

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, January 2018

Performance Analysis of Parallel Scientific Applications In Eclipse

Organization of User Interface Software

Transcription:

Purpose: How to train an MLP neural network in MATLAB environment! that is For good computations, we need good formulae for good algorithms; and good visualization for good illustration and proper testing of good methods and succesfull applications!

About APIs: How to link other programs and MATLAB Needed for using existing subroutines or libraries from MATLAB speeding up MATLAB especially for for-loops API supports, e.g., usage of C- and Fortran-routines as M-files (MEX) import and export of variables (data) (MAT) Java-support (from version 6 JVM included in environment) communication with PC applications using DDE (Dynamic Data Exchage), usage of MATLAB as an AciveX-server mxarray intrinsic representation of varibles in MATLAB Example: setting x = 2 creates a structure ------------------------------------------------------- Name: x Dimensions: 1x1 Class Name: double ------------------------------------------------------- (1,1) = 2 MEX-program gets information from MATLAB workspace: prefix mx Example: mxgetpr(plhs[0]) MEX-program puts information to MATLAB workspace: prefix mex Example: mexerrmsgtxt( Error... ).

function [j1,grad] = rosenbrock(x,cof) %Modification of Erkki Heikkola s func2d.m (TK 11.11.02) j1 = cof * (x(2) - x(1)^2)^2 + (1 - x(1))^2; grad = zeros(size(x)); grad(1) = -4 * cof * x(1) * (x(2) - x(1)^2) - 2 * (1 - x(1)); grad(2) = 2 * cof * (x(2) - x(1)^2); #include "mex.h" void rosenb(double x[],double cof,double *j1,double grad[]) { double t1, t2; t1 = x[1] - x[0]*x[0]; t2 = 1e0 - x[0]; *j1 = cof*t1*t1 + t2*t2; grad[0] = -4e0*cof*x[0]*t1-2e0*t2; grad[1] = 2e0*cof*t1; return; /* The gateway function. */ void mexfunction( int nlhs, mxarray *plhs[], int nrhs, const mxarray *prhs[]) { int n, m; double *x, cof, *j1, *grad; /* Check for proper number of arguments */ if (nrhs!=2) mexerrmsgtxt("two inputs required."); else if... /* Treatment of inputs, vector x and scalar cof. */ x = mxgetpr(prhs[0]); n = mxgetn(prhs[0]); m = mxgetm(prhs[0]); cof = mxgetscalar(prhs[1]); /* Allocate and attach the outputs. */ plhs[0] = mxcreatedoublematrix(1,1,mxreal); j1 = mxgetpr(plhs[0]); plhs[1] = mxcreatedoublematrix(m,n,mxreal); grad = mxgetpr(plhs[1]); /* Compute the result using C subroutine. */ rosenb(x,cof,j1,grad);

Example (cont.): compilation of c-routine from workspace: >> mex -O rosenbrock_c.c testing as usual: x = rand(1,2); cof = 1e3; [j1_m,grad_m] = rosenbrock(x,cof); [j1_c,grad_c] = rosenbrock_c(x,cof); norm(j1_m-j1_c), norm(grad_m-grad_c) calling MATLAB from a mex file (core of median filter): void medflt(double u[],double z[],int n,int m,int v1,int v2) { int xs, ys, ws, i, j, ind, num_in = 1, num_out = 1; double *wp, *op, *ip; mxarray *w, *w1, *out_array[1], *in_array[1]; xs = v1/2; ys = v2/2; ws = v1*v2; w1 = mxcreatedoublematrix(v1,1,mxreal); w = mxcreatedoublematrix(ws,1,mxreal); ind = xs; for (j = xs; j < m-xs; j++) { wp = mxgetpr(w); in_array[0] = w; for (i = ys; i < n-ys; i++) { setw (wp,z,i,j,n,xs,ys); /* values of z within window */ mexcallmatlab(num_out,out_array,num_in,in_array,"median"); op = mxgetpr(out_array[0]); u[ind++] = *op; return;

User Interface is a single entity that helps user to perform the desired tasks. Key questions: (0. Does the user really knows what he/she wants?) 1. Does the user now where he/she is at every time? 2. Does the user now what happens next at every time? Usability: learnability: novice s time to be able to use the system efficiency: performance for a skilful user memorability: consistency of appearance faultlessness: amount and type of errors (that always exist) satisfaction: subjective feeling, approachbility flexibility: behaviour for new tasks in new environments effectiveness: accomplishment of the targets for usage Program development paradigm: Star model by Preece et al (1994) Task Analysis Implementation Assesment/ Validation Requirement Engineering Prototyping Functional Planning and Formal Specification

Menus: familiar part of many window s toolbars >> Hm_l = uimenu(hx_parent, Propertyname,Propertyvalue,...) where Hx_parent is parent-go s handle (figure or parent-uimenu) properties Accelerator,BusyAction,ButtonDownFcn,Callback,Checked, Children,Clipping,CreateFcn,DeleteFcn,Enable,ForeGroundColor HandleVisibility,HitTest,Interruptible,Label,Parent,Position Selected,SelectionHighlight,Separator,Tag,Type,UserData,Visible Most important: Label visible text on top of one selection, CallBack name of routine to be evaluated when selected Contextual menus: like menus, but can be attached to any GO >> Huix = uicontextmenu(hf_parent, Propertyname,PV,...) Hf_parent figure-handle, attachment to GO by setting Huix to Contextmenu-property, creation of actual menu using uimenu Controls: >> Hc_l = uicontrol(hf_parent, Propertyname,Propertyvalue,...) properties BackgroundColor,BusyAction,ButtonDownFcn,Callback,Cdata, Children,Clipping,CreateFcn,DeleteFcn,Enable,Extent,FontAngle, FontName,FontSize,FontUnits,FontWeight,ForegroundColor, HandleVisibility,HitTest,HorizontalAlignment,Interruptible, ListboxTop,Max,Min,Parent,Position,Selected,SelectionHighlight, SliderStep,String,Style,Tag,TooltipString,Type,UiContextMenu, Units,UserData,Value,Visible Most important: Style that determines control type to pushbutton: mouse-activated action using ButtonDownFcn-property togglebutton: like previous, but with only two possible states (Max and Min) radiobutton: selection of one from a group of mutually exclusive choices checkbox: setting state or attribute on or off edit: editable text for user to modify

text: static text, e.g., for announcements slider: (SCROLL BAR) selection of value from a given interval by sliding the mouse frame: for visual separation of a group of uicontrol-objects listbox: selection of one or many strings from given list of choices popupmenu: presentation of mutually exclusive choices for the user Miscellaneous-stuff mouse capturing and event activation: GO s Callback- and Enableproperties, figures CurrentPoint-, SelectionType-, WindowButton- MotionFcn- and WindowButtonDownFcn-properties and uicontrols ButtonDownFcn actual event selection and activation using event queue gcbo handle to present callback-object and gcbf handle to corresponding father-figure Built-in dialogs for application-user interaction: Function axlimdlg dialog errordlg helpdlg inputdlg listdlg menu msgbox pagedlg pagesetupdlg printdlg printpreview questdlg uigetfile uiputfile uisetcolor uisetfont waitbar warndlg GUI realization: Use GUIDE! Description Axes limits dialog box. Create figure for dialog box or GUI. Error dialog box. Help dialog box. Input dialog box. List selection dialog box. Menu choice selection dialog box. Generic message dialog box. Page position dialog box. Page setup dialog box. Print dialog box. Print preview dialog box. Question dialog box. Standard open file dialog box. Standard save file dialog box. Color selection dialog box. Font and font attributes dialog box. Display wait bar. Warning dialog box.