Modern DBMS provide ample opportunities of developing various information systems. DB objects are represented by tables for data storage, stored procedures for data processing and various calculations, triggers and diagrams for description of the relations between tables. Trigger is a stored procedure of special type, that is automatically executed in response to certain events on a particular table in a database.
Implementation of event-threading algorithm is possible in DBMS that supports triggers, event-threading model and table creation in trigger body.
Introduction
Nowadays there exist several models of artificial neural networks (ANN) and their realizations. It is known that ANN solve many classes of problems such as classification, clustering, categorization, function approximation, predicting, forecasting, optimization, associative memory, etc.
Algorithm etANN handles input data using new principles and methods based on parallel algorithms, event-driven model or database trigger model and new approaches of ANN training and synthesis of trained network. This usage etANN allows decreasing the number of operations from O(n) (classical models) down to O(ln n) (etANN mode).
Definitions
ANN is a directional graph with weighted connections and artificial neurons in its nodes. By architecture ANN connections can be grouped in two classes - direct propagation networks with graph without loops and recurrent or back-propagation networks.
Connection between two artificial neurons is associated with events in case of event-driven model realization or with triggers when etANN is realized in database.
Server starts trigger automatically when you try to change data in the table which the trigger is associated to. All data modifications are performed as transaction, which holds the action that caused the trigger to fire. Rollback of transaction may occur in the case of error or data corruption.
Storage and functioning of the ANN in database requires a few preliminary stages of collecting and normalizing data, construction of network topology and determining its characteristics, specifying the parameters of training. Repetitive (periodic) stages of training, adjustment and verbalization of ANN are performed as well.
Preliminary stages are implemented through stored procedures and periodic stages designed by triggers of tables that store network architecture.
Realization of etANN in Database
ANN models usually are presented in the form n-partite oriented graph K (m1, . . ., mn), where mi - size of layer (part); each neuron from layer i is connected with each neuron from layer i+1, where i from [1, m].
Let define logical entities of ANN, such as layers, neurons, connections and special parameters.
Layers/parts: {Li}, i in {1, n}.
Neurons: {Niji}, i in {1, n}, ji in {1, mi}.
Connections: {cNijiNklk}, i,k in {1, n}, ji in {1, mi}, lk in {1, mk}.
Where n - layers(parts) count, mi, mk - neurons count(layer size) in layer i, k, number of connections,
Special ANN parameters
training speed a, error threshold theta, size of training d1, testing selection d2, size of model k - number of researched etANN characteristics, which defines input layer size; each characteristic has its own definitions domain; precision of researched characteristics o(A), operating variables Z = { zi }, casual and undefined variables Xi = x{i1}, number of training epochs (cycles) ti, which cannot be defined a priori, because it depends on assigned data for training and concrete ANN structure, domain of admissible solutions Y = {y1}.
Training and testing time series - vectors xuv, vector length equal to m1 size of input layer, count is defined by d1+d2. Admissible solutions are defined immediately during the training when ANN is configured. Research determines the form of admissible definitions and the domain of values. Triggers are mostly used for keeping the integrity of the information on the database. In etANN triggers are used only for ANN training.
The exact and correct implementation of stored procedure varies from one database system to another. Major database vendors support them. Depending on the database system, stored procedures can be implemented in a variety of programming languages, for example SQL, Java, C# or C++.
DBMS that supports stored procedures and triggers are Microsoft SQL Server, Oracle, IBM DB2, PostgreSQL, Firebird, MySQL. Parallel queries supports Microsoft SQL Server, Oracle and IBM DB2.
Database Structure
Possible logical structure of database to store etANN entities basing on database design principles:
Tables:
Table [Parameters] have fields { id PK, name, value} stores etANN configuration A.
Table [Layers] { id PK, name} stores all of etANN layer elements.
Table [Neurons] { id PK, layerid, name, inner_potential, max_potential} stores all neurons of etANN.
Table [Connections] { id PK, neuronid_from, neuronid_to, weight} stores all connections between neurons.
Table [TimeSeries] { (series_id, neuron_id) PK, value} stores all vectors for training and testing etANN.

Triggers
Database transactions in created tables depends on triggers which fires after insert data in [TimeSeries] table, and after update tables [Neurons] and [Connections].
Trigger [after_insert_TimeSeries] update inner potential of input layer in [Neurons] table with data from training time series vector in :NEW variable. SQL script below:
CREATE TRIGGER after_insert_TIMESERIES AFTER INSERT ON TIMESERIES FOR EACH ROW BEGIN UPDATE [Neurons] nr SET nr.inner_potential += :NEW.value * nr.inner_potential WHERE nr.ID = :NEW.neuron_id; END;
Trigger [after_update_Neurons] check for inner potential of which neuron in input layer, if inner potential more or equal than maximum possible potential value of neuron, than are executed update of neuron states in next layer (chain reaction in etANN). SQL script:
CREATE TRIGGER after_update_NEURONS AFTER UPDATE ON NEURONS FOR EACH ROW BEGIN IF(:NEW.inner_potential >= :NEW.max_potential) UPDATE [Connections] cn SET cn.weight = Gaussian(:NEW.inner_potential, :NEW.max_potential) WHERE cn.neuronid_from = :NEW.id; :NEW.inner_potential = MOD(:NEW.inner_potential, :NEW.max_potential); END IF; END;Gaussian threshold function of activation. Modulus (MOD) operation finds the remainder of pision of inner potential by max potential(threshold).
Trigger [after_update_Connections] change inner potential for neurons which are connected with modified neurons from previous layer.
CREATE TRIGGER after_update_CONNECTIONS AFTER UPDATE ON CONNECTION FOR EACH ROW BEGIN UPDATE [Neurons] nr SET nr.inner_potential += :NEW.weight * nr.inner_potential WHERE nr.ID = :NEW.neuronid_to; END;Algorithm
1. Collect and normalize data: Select data for table [TimeSeries].
2. Construct ANN topology: Create and fill tables [Neurons], [Layers] and [Connections].
3. Define characteristics: Create and fill table [Parameters].
4. Training ANN: Run filling of [TimeSeries] table with training data.
5. Testing ANN: Run filling of [TimeSeries] table with testing data.
Conclusion
Essential modification of classical ANN structure consists in elimination of all unessential connections (threads) after handling by\etann calculation algorithm and introduced dynamics considerably reduces delays in calculations because all operations take place in real-time.
New theoretical mechanism for data handling on testing and application stage of ANN development, being based on asynchronous threads in networks and developed tools, solves formulated problems more effectively and much faster.
Performance increase is reached by parallel work of all database transactions/triggers and database architecture based on alternative model. etann is oriented to eliminate three classical problems related to parallelism support in software applications. Classical problems in parallel (multi-threading) programming are double blocks, lack of blocks elimination, incorrect blocks order and execution of block operations in critical important sections of the application. Errors of this kind lead to serious and unpredictable performance degradation. In the modern DBMS this problems are solved with the aid of integrated technologies of parallel queries.
Bibliography
A. Kior. Event-threading calculation algorithm complexity estimation.
MITRE CECMI, Moldova State University, 2009, pp. 89-92.
V.S. Ramachandran. Encyclopedia of the Human Brain.
Elsevier Science, USA, 2002.
J. Hopfield. Cooperative and Competitive Neural Networks.
USA, Japan, 1982.
Theoretical Neuroscience - Computational and Mathematical Modeling of Neural Systems.
MIT Press, 2000.
S. Bresler. Advances of physical sciences: Biophysics problems.
Science Academy UdSSR, Institute of High-molecular compounds, 1969.
J.L.Harrington. Relational Database Design.
Academic Press, 1998.
T. Kyte. Expert One-on-One Oracle.
Pearson Education, 2002.
L. Liu, M.T. Ozsu. Encyclopedia of Database Systems.
Springer, 2009.
Comparison of relational database management systems. 2011.
No comments:
Post a Comment