Neural networks: a graphical user interface 


Мы поможем в написании ваших работ!



ЗНАЕТЕ ЛИ ВЫ?

Neural networks: a graphical user interface



Laboratory work #1

Topic: An Introduction to the basic concepts of neural networks. The study package MATLAB, its major functions and features. The study of the interface of the package.

Purpose: the acquisition of basic skills program robots, study the subject area, and the study of the basic principles of the MATLAB language.

 

MATLAB Language

Description of language

Language MATLAB is a high-interpreted programming language, including matrices based on data structures, a wide range of functions, integrated development environment, object-oriented features and interfaces to programs written in other programming languages.

Programs written in MATLAB, are of two types - functions and scripts. Functions have input and output arguments, as well as your own work space to store intermediate results of calculations and variables. Scripts also use a common workspace. As scripts and functions are not compiled into machine code and saved as text files. There is also an option to save the so-called ‘’Pre-ragzes1’’ program - functions and scripts are processed into a form suitable for machine execution. In general, such programs run faster than normal, especially if the function contains commands for plotting.

The main feature of the MATLAB language is its opportunities for working with matrices, which are the creators of the language expressed in the slogan "Think vector."

 

Mathematics and Computing

MATLAB provides user with a great quantity (several hundreds) of functions for data analysis, including almost all spheres of math:

- Matrix and linear algebra – matrix algebra, linear equations, eigenvalues and vectors, singularities, matrix factorization and others.

- Polynomials and interpolation – roots of polynomials, operations on polynomials and their differentiation, interpolation and extrapolation of curves and others.

- Mathematical statistics and data analysis – statistical functions, statistical regression, digital filtering, far Fourier transform and others.

- Data processing – a set of special functions, including plot assay, optimization, search of zeros, numerical integration (in quadrature) and others.

- Differential equations – solution of differential and differential-algebraic equations, differential equations with delay, equations with restrictions, partial differential equations and others.

- Sparse matrices – special class of the data package of Matlab, which is used in special apps.

- Integer arithmetic’s – execution of operations of integer arithmetic’s in the sphere of Matlab.

 

Algorithm development

MATLAB provides a convenient means for algorithm development, including a high-level with a usage of objective-oriented programming operations. It has all the necessary tools of the IDE, including debugger and profiler. Functions to work with integer data types facilitate creation of algorithms for MICROCONTROLLER and other applications where it is necessary.

 

Data visualization

As part of the package MATLAB has more functions for plotting, including three-dimensional, visual data analysis and creation of animated movies.

Integrated development environment allows you to create graphical user interfaces with a variety of controls such as buttons, input fields, and others. Using component of MATLAB Compiler these graphical interfaces can be transformed into independent application to run on which other computers must has library of MATLAB Component Runtime.

 

External interfaces

MATLAB package includes a variety of interfaces for accessing external routines written in other programming languages​​, data, clients and servers that communicate with help technology Component Object Model or Dynamic Data Exchange and peripheral devices that interface directly with MATLAB. Many of these features is known as MATLAB APL.

 

COM

MATLAB package provides access to functions that enable you to create, manipulate, and delete the COM objects (such as clients and servers). Also supports technology of ActiveX. All COM objects belong to a special class of the COM package MATLAB. All programs that have functions of the controller can access MATLAB as an Automation server.

 

. NET


The package of MATLAB in Microsoft Windows gives access to the programmatic platform.NET Framework. There is possibility to load.NET of assembling(Assemblies) and to work with objects.NET of classes from the environment of MATLAB. In a version MATLAB 7.11(R2010b) is supported.NET Framework by a version 2.0, 3.0,3.5 and 4.0.

 

DDE


The package of MATLAB contains functions that allow to get access him to other appendixes of environment of Windows, exactly as well as to get access these applications to data of MATLAB, by means of technology of dynamic exchange by data(DDE). Every application, that can be DDE- the unique identification identifier has a server,. For MATLAB there is this name- Matlab.

COM- port

An interface for serial port of package of MATLAB provides direct access to peripheral units, such as modems, printers and scientific equipment, connected to the computer through serial port(COM- port). An interface works by creation of object of the special class for serial port. The present methods of this class allow to read and write down data in serial port, to use events and processers of events, and also to write down information on the disk of computer real-time. It is the experiments not walked around during realization, simulations of the real time and for other.

МЕХ- files
The package of MATLAB includes the interface of co-operating with the external applications written on languages С and Fortran. This co-operation comes true through МЕХ-файлы. There is possibility of call of the programs written on With or Фортране from MATLAB, as though it is intrinsic functions of package. МЕХ-files are renaming dinamically. The correct setting of access paths is set by default, so that given an opportunities it is needed to use only in the special circumstances, for example at the casual transfer of folders elsewhere or at their renaming.

Sets the default correct installation paths, so that these possibilities should only be used in special circumstances, such as the accidental transfer of folders to another location or rename them.

 

Fig. 1.11. Editor file system paths

 

The menu "Edit" - tools for editing documents

"Edit" menu contains the editing operations and commands typical for most Windows applications:

- Undo – canceling of result of previous operation;

- Redo – canceling of last Undo operation;

- Cut – cutting of dedicated fragment and transferring it to buffer;

- Paste – inserting of fragment from buffer into current position of cursor;

- Clear – operation of clearing of dedicated area;

- Select All – dedication all of session;

- Delete – determination of dedicated area;

- Clear Command Windows – clearing of text of session (with saving of created objects);

- Clear Command History - cleaning history window;

- Clear Workspace - cleaning the work area of the browser window.

Fig. 1.13. Menu «Edit».

 

DLL

Interface of MATLAB, referring to the common DLL, allows you to call functions, which are placed in dynamic link libraries, directly from MATLAB. These functions must have a C-interface.

In addition, in MATLAB it is possible to get access to its built-in functions by the C-interface that lets you use the functions of a package in external applications written in C. This technology of MATLAB is called a C-Engine.

Toolboxes

In MATLAB it is possible to create special toolboxes that extend its functionality. Toolboxes are collections of functions, written on MATLAB language, to solve a certain class of problems. The company Mathworks supplies toolboxes that are used in many spheres, including the following:

· Digital signal, image and data processing: DSP Toolbox, Image Processing Toolbox, Wavelet Toolbox, Communication Toolbox, Filter Design Toolbox - sets of functions that allow you to solve a wide range of tasks of signal processing, image processing, design of digital filters and communication systems.

· Control systems: Control Systems Toolbox, i-Analysis and Synthesis Toolbox, Robust Control Toolbox, System Identification Toolbox, LMI Control Toolbox, Model Predictive Control Toolbox, Model-Based Calibration Toolbox - sets of functions that facilitate the analysis and synthesis of dynamic systems, design, modeling and identification of control systems, including advanced control algorithms, such as robust control, LMI-synthesis, p-synthesis, and others.

· Financial analysis: GARCH Toolbox, Fixed-Income Toolbox, Financial Time Series Toolbox, Financial Derivatives Toolbox, Financial Toolbox, Datafeed Toolbox – a set of functions, that allows us quickly and efficiently collect, process, and transmit various financial information.

· Analysis and synthesis of maps, including three-dimensional: Mapping Toolbox.

· Collection and analysis of experimental data: Data Acquisition Toolbox, Image Acquisition Toolbox, Instrument Control Toolbox, Link for Code Composer Studio – a set of functions, that allows us save and process data obtained during the experiments, including in real time. Supporting a wide range of scientific and engineering measuring equipment.

· Visualization and representation of data: Virtual Reality Toolbox – allows us to create interactive worlds and visualize scientific data using virtual reality technology and language VRML.

· Development tools: MATLAB Builder for COM, MATLAB Builder for Excel, MATLAB Builder for NET, MATLAB compiler, Filter Design HDL Coder – sets of functions that allows us to create independent applications of the environment MATLAB.

· Interaction with external software products: MATLAB Report Generator, Excel Link, Database Toolbox, MATLAB Web Server, Link for ModelSim – a set of functions, that allows us save data in various forms so that other programs can work with them.

· Databases: Database Toolbox – tools for working with databases.

· Scientific and mathematical packs: Bioinformatics Toolbox, Curve Fitting Toolbox, Fixed-Point Toolbox, Fuzzy Logic Toolbox, Genetic Algorithm and Direct Search Toolbox, OPC Toolbox, Optimization Toolbox, Partial Differential Equation Toolbox, Spline Toolbox, Statistic Toolbox, RF Toolbox – are packs of specialized mathematical functions, which can solve great part of scientific and engineer problems, including a development of genetic algorithms; solving problems in partial derivatives, problems with integers, optimization of systems etc.

· Neuron systems: Neural Network Toolbox – are instruments for creating and analyzing neuron systems.

· Fuzzy logic: Fuzzy Logic Toolbox – are instruments for building and analyzing fuzzy varieties.

MATLAB interface

Simplified interface

The user can control a view of an interface and locate windows where he/she likes. Using command View > Desktop Layout > Command Window Only we can obtain “an old” variant of view of an interface – pic. 1.1. The only innovations in interface are position of Web menu and access to file system from control panel. Besides, window with access to the control panel is shown on the pic. 1.1 too.

Sometimes MATLAB denied to perform some commands because of some m-files aren’t in current folder. That’s why quick access to file system from the users interface is useful in this pogram.

For editing and debugging m-files MATLAB has built-in modern editor, interface of which is made in the best traditions of Windows-applications. The window of memory resources information, window of file system ways, capability of system support and demonstration programs are made in the same style. Design of graphical editor and graphical window were described before.

 

 

Pic. 1.1. Simplified interface of MATLAB.

 

Control panel tolls

Control panel (pic. 1.2) provides the easiest and most exiting (especially for beginners) way of working with MATLAB system. All basic commands are work with the help of mouse pointer and left mouse click. Each button has a hint of function it is made for.

Pic. 1.2. Part of MATLAB system window with menu and panel

Before we start, let’s list all buttons of control panel:

- New M-file — display a blank screen editor of m-files;

- Ореп file — open a window to load m-files;

- Cut — cut the selected fragment and puts it to the clipboard;

- Сору — copy selected fragment to the clipboard;

- Paste — move fragment from the clipboard to the current line of input;

- Undo — cancel the previous operation;

- Redo — restore the last canceled operation;

- Simulink — open the Library Browser of Simulink;

- Неlр — open the Help window.

Displaying the opening of the new file

Button New M-file opens a window of editor / debugger of m-files. This window is shown on Fig. 1.3.


Fig. 1.3. Clear window of editor / debugger of m-files.

By default, the file is given the name Untitled, which (when a file is writing) can be changed to another later, reflecting the theme of the problem. This name appears in the title bar of the editing window of m-file, which is located in the editor / debugger and can be seen in Fig. 1.3. In the Editor / Debugger, you can edit a few m-files, and each of them will be in your edit window, but active can be only one window, located on top of other windows.

Note that the toolbar is context-dependent. The editor / debugger of m-files has a different set of tools than the Command mode (see Fig. 1.1).

Note that the toolbar is context-dependent. The editor / debugger of m-files has a different set of tools than the Command mode (see Fig. 1.1).

Clipboard operations

Cut command performs cutting of selected fragment and storing it into clipboard. During this operation cut fragment deletes from the document text. Copy command copies selected fragment into clipboard, saving it in text. Paste command takes object from clipboard and insert it in document on cursor position. These operations may be realized both by correspondent hot keys or commands from Edit menu. In MATLAB you can use context menu, that appears on mouse right click. For example, after mouse right click on selected fragment of matrix M you can see menu, shown of pic. 1.5. Copy command is duplicated here, also a set of other commands available here at this moment. Pay attention, that during preparing of magic matrix M her name appears in working area of browser window – in right part of display. At the same time matrix is presented in form of table.

Clipboard contents can be transferred into input row window of m-files editor-debuger or even in another application. Suppose we want to create matrix M1 with content, that is stored in clipboard. For this type M1=[ and make right mouse click, then choose command Paste. This operation is shown on pic. 1.6.

 

Pic. 1.6 Preparation for inserting data from the buffer

Execute the command Paste, you can see that the data stored in the buffer matrix appear after the opening bracket. To create a matrix of type M1 remains only enter bracket ] and press Enter.
In pic. 1.7 shows how to create a matrix M1, the contents of similar matrix M.

Fig. 1.7. Example of creating a matrix M1 with content taken from the buffer.

Accessing Help in MATLAB

The last button toolbar Help (Help) opens with a list of Help topics.

File structure Browser

To view the file structure of MATLAB is a special file system browser (Path Browser), which is run in normal boot. If you installed a simplified interface to run the file system used by the browser window Current Directory (current folder). Pic.1.8 on the left side of the browser window is displayed.

It is easy to see that file system browser designed as a well-known explorer operating systems Windows 95/98/Me/2000/NT4. The window allows you to view the file system of the PC and select any file. For example, in Fig. 1.8 shows the choice m-file sine function.

Execute the command Open from the context menu of the right mouse button, or double-clicking on the highlighted line to the file name, you can enter the file in the editor / debug
 
 

ger m-files. In this case, the editor will automatically start and the window ready for editing the selected file will be displayed in Fig. 1.8.

Fig. 1.8. An example of the browser window “Path Browser”

Using the menu

Menu of the system

- File – work with files;

- Edit – redaction of the session;

- View – output and hiding the panel of instruments;

- Web - access to internet resources;

- Windows – installation of Windows settings;

- Help – access to reference subsystem;

 

Submenu File

Menu File contain next operations

 

- New – open submenu with positions;

- M-file – open the window of redactor/ debugger of m-files;

- Figure – opening an empty window of graphics;

- Model – opening an empty window for creation Simulink-models;

- GUI – opening the creation window of graphic user interface elements;

- Open – open the file loading window;

- Close Command Windows – close the window of command regime;

- Import data – open the import window of data files;

- Save Workspace As - open recording window workspace as a file with the given name;

- Set path – open the installation window of access ways of file system;

- Preferences – open the setting window of interface;

- Print – open the print window of the whole common interface;

- Print selection – open the print window of selected part document;

- Exit – ends the work with the system.

 

Fig. 1.9 Menu of file operations «File».

TASK

Create and train neuron network to perform an operation y=x12+x2, if the input order is given P1=[1 0.5 0 1; -2 0 0.5 1] and aims T1=[-1 0.25 0.5 2].

 

 

Laboratory work #1

Topic: An Introduction to the basic concepts of neural networks. The study package MATLAB, its major functions and features. The study of the interface of the package.

Purpose: the acquisition of basic skills program robots, study the subject area, and the study of the basic principles of the MATLAB language.

 

MATLAB Language

Description of language

Language MATLAB is a high-interpreted programming language, including matrices based on data structures, a wide range of functions, integrated development environment, object-oriented features and interfaces to programs written in other programming languages.

Programs written in MATLAB, are of two types - functions and scripts. Functions have input and output arguments, as well as your own work space to store intermediate results of calculations and variables. Scripts also use a common workspace. As scripts and functions are not compiled into machine code and saved as text files. There is also an option to save the so-called ‘’Pre-ragzes1’’ program - functions and scripts are processed into a form suitable for machine execution. In general, such programs run faster than normal, especially if the function contains commands for plotting.

The main feature of the MATLAB language is its opportunities for working with matrices, which are the creators of the language expressed in the slogan "Think vector."

 

Mathematics and Computing

MATLAB provides user with a great quantity (several hundreds) of functions for data analysis, including almost all spheres of math:

- Matrix and linear algebra – matrix algebra, linear equations, eigenvalues and vectors, singularities, matrix factorization and others.

- Polynomials and interpolation – roots of polynomials, operations on polynomials and their differentiation, interpolation and extrapolation of curves and others.

- Mathematical statistics and data analysis – statistical functions, statistical regression, digital filtering, far Fourier transform and others.

- Data processing – a set of special functions, including plot assay, optimization, search of zeros, numerical integration (in quadrature) and others.

- Differential equations – solution of differential and differential-algebraic equations, differential equations with delay, equations with restrictions, partial differential equations and others.

- Sparse matrices – special class of the data package of Matlab, which is used in special apps.

- Integer arithmetic’s – execution of operations of integer arithmetic’s in the sphere of Matlab.

 

Algorithm development

MATLAB provides a convenient means for algorithm development, including a high-level with a usage of objective-oriented programming operations. It has all the necessary tools of the IDE, including debugger and profiler. Functions to work with integer data types facilitate creation of algorithms for MICROCONTROLLER and other applications where it is necessary.

 

Data visualization

As part of the package MATLAB has more functions for plotting, including three-dimensional, visual data analysis and creation of animated movies.

Integrated development environment allows you to create graphical user interfaces with a variety of controls such as buttons, input fields, and others. Using component of MATLAB Compiler these graphical interfaces can be transformed into independent application to run on which other computers must has library of MATLAB Component Runtime.

 

External interfaces

MATLAB package includes a variety of interfaces for accessing external routines written in other programming languages​​, data, clients and servers that communicate with help technology Component Object Model or Dynamic Data Exchange and peripheral devices that interface directly with MATLAB. Many of these features is known as MATLAB APL.

 

COM

MATLAB package provides access to functions that enable you to create, manipulate, and delete the COM objects (such as clients and servers). Also supports technology of ActiveX. All COM objects belong to a special class of the COM package MATLAB. All programs that have functions of the controller can access MATLAB as an Automation server.

 

. NET


The package of MATLAB in Microsoft Windows gives access to the programmatic platform.NET Framework. There is possibility to load.NET of assembling(Assemblies) and to work with objects.NET of classes from the environment of MATLAB. In a version MATLAB 7.11(R2010b) is supported.NET Framework by a version 2.0, 3.0,3.5 and 4.0.

 

DDE


The package of MATLAB contains functions that allow to get access him to other appendixes of environment of Windows, exactly as well as to get access these applications to data of MATLAB, by means of technology of dynamic exchange by data(DDE). Every application, that can be DDE- the unique identification identifier has a server,. For MATLAB there is this name- Matlab.

COM- port

An interface for serial port of package of MATLAB provides direct access to peripheral units, such as modems, printers and scientific equipment, connected to the computer through serial port(COM- port). An interface works by creation of object of the special class for serial port. The present methods of this class allow to read and write down data in serial port, to use events and processers of events, and also to write down information on the disk of computer real-time. It is the experiments not walked around during realization, simulations of the real time and for other.

МЕХ- files
The package of MATLAB includes the interface of co-operating with the external applications written on languages С and Fortran. This co-operation comes true through МЕХ-файлы. There is possibility of call of the programs written on With or Фортране from MATLAB, as though it is intrinsic functions of package. МЕХ-files are renaming dinamically. The correct setting of access paths is set by default, so that given an opportunities it is needed to use only in the special circumstances, for example at the casual transfer of folders elsewhere or at their renaming.

Sets the default correct installation paths, so that these possibilities should only be used in special circumstances, such as the accidental transfer of folders to another location or rename them.

 

Fig. 1.11. Editor file system paths

 

The menu "Edit" - tools for editing documents

"Edit" menu contains the editing operations and commands typical for most Windows applications:

- Undo – canceling of result of previous operation;

- Redo – canceling of last Undo operation;

- Cut – cutting of dedicated fragment and transferring it to buffer;

- Paste – inserting of fragment from buffer into current position of cursor;

- Clear – operation of clearing of dedicated area;

- Select All – dedication all of session;

- Delete – determination of dedicated area;

- Clear Command Windows – clearing of text of session (with saving of created objects);

- Clear Command History - cleaning history window;

- Clear Workspace - cleaning the work area of the browser window.

Fig. 1.13. Menu «Edit».

 

Neural networks: a graphical user interface

Neural Networks (NN) are widely used to solve various problems. Among the developing regions of NN - processing of analog and digital signals, the synthesis and identification of electronic circuits and systems. Basic theory and technology of NN are well represented in the package MATLAB. In this regard, special mention should be on version of the package - MATLAB 6.0, which was first presented GUI (Graphical User Interface) for the NN - NNTool.

Examples of application of the technology of neural networks for digital signal processing are: filtering, parameter estimation, detection, identification of systems, pattern recognition, reconstruction of the signals, time series analysis and compression. These kinds of processing are applicable to various types of signals: audio, video, voice, images, message, geophysical, locating, medical measurements (cardiograms, entsefallogrammy, pulse), and others.

Signal processing in technologies of NN performed by NN without memory or NN with memory. And in both cases, the key element is the NN without memory. Such a role is defined by the fact that the use of neurons with specific functions of activation (transfer characteristics) NN is the link libraries that can be downloaded and executed by interpretator built into MATLAB. MEX-procedures are also able to call built-in commands of MATLAB.

DLL

Interface of MATLAB, referring to the common DLL, allows you to call functions, which are placed in dynamic link libraries, directly from MATLAB. These functions must have a C-interface.

In addition, in MATLAB it is possible to get access to its built-in functions by the C-interface that lets you use the functions of a package in external applications written in C. This technology of MATLAB is called a C-Engine.

Toolboxes

In MATLAB it is possible to create special toolboxes that extend its functionality. Toolboxes are collections of functions, written on MATLAB language, to solve a certain class of problems. The company Mathworks supplies toolboxes that are used in many spheres, including the following:

· Digital signal, image and data processing: DSP Toolbox, Image Processing Toolbox, Wavelet Toolbox, Communication Toolbox, Filter Design Toolbox - sets of functions that allow you to solve a wide range of tasks of signal processing, image processing, design of digital filters and communication systems.

· Control systems: Control Systems Toolbox, i-Analysis and Synthesis Toolbox, Robust Control Toolbox, System Identification Toolbox, LMI Control Toolbox, Model Predictive Control Toolbox, Model-Based Calibration Toolbox - sets of functions that facilitate the analysis and synthesis of dynamic systems, design, modeling and identification of control systems, including advanced control algorithms, such as robust control, LMI-synthesis, p-synthesis, and others.

· Financial analysis: GARCH Toolbox, Fixed-Income Toolbox, Financial Time Series Toolbox, Financial Derivatives Toolbox, Financial Toolbox, Datafeed Toolbox – a set of functions, that allows us quickly and efficiently collect, process, and transmit various financial information.

· Analysis and synthesis of maps, including three-dimensional: Mapping Toolbox.

· Collection and analysis of experimental data: Data Acquisition Toolbox, Image Acquisition Toolbox, Instrument Control Toolbox, Link for Code Composer Studio – a set of functions, that allows us save and process data obtained during the experiments, including in real time. Supporting a wide range of scientific and engineering measuring equipment.

· Visualization and representation of data: Virtual Reality Toolbox – allows us to create interactive worlds and visualize scientific data using virtual reality technology and language VRML.

· Development tools: MATLAB Builder for COM, MATLAB Builder for Excel, MATLAB Builder for NET, MATLAB compiler, Filter Design HDL Coder – sets of functions that allows us to create independent applications of the environment MATLAB.

· Interaction with external software products: MATLAB Report Generator, Excel Link, Database Toolbox, MATLAB Web Server, Link for ModelSim – a set of functions, that allows us save data in various forms so that other programs can work with them.

· Databases: Database Toolbox – tools for working with databases.

· Scientific and mathematical packs: Bioinformatics Toolbox, Curve Fitting Toolbox, Fixed-Point Toolbox, Fuzzy Logic Toolbox, Genetic Algorithm and Direct Search Toolbox, OPC Toolbox, Optimization Toolbox, Partial Differential Equation Toolbox, Spline Toolbox, Statistic Toolbox, RF Toolbox – are packs of specialized mathematical functions, which can solve great part of scientific and engineer problems, including a development of genetic algorithms; solving problems in partial derivatives, problems with integers, optimization of systems etc.

· Neuron systems: Neural Network Toolbox – are instruments for creating and analyzing neuron systems.

· Fuzzy logic: Fuzzy Logic Toolbox – are instruments for building and analyzing fuzzy varieties.

MATLAB interface

Simplified interface

The user can control a view of an interface and locate windows where he/she likes. Using command View > Desktop Layout > Command Window Only we can obtain “an old” variant of view of an interface – pic. 1.1. The only innovations in interface are position of Web menu and access to file system from control panel. Besides, window with access to the control panel is shown on the pic. 1.1 too.

Sometimes MATLAB denied to perform some commands because of some m-files aren’t in current folder. That’s why quick access to file system from the users interface is useful in this pogram.

For editing and debugging m-files MATLAB has built-in modern editor, interface of which is made in the best traditions of Windows-applications. The window of memory resources information, window of file system ways, capability of system support and demonstration programs are made in the same style. Design of graphical editor and graphical window were described before.

 

 

Pic. 1.1. Simplified interface of MATLAB.

 



Поделиться:


Последнее изменение этой страницы: 2016-04-25; просмотров: 254; Нарушение авторского права страницы; Мы поможем в написании вашей работы!

infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 3.16.15.149 (0.178 с.)