Научная статья на тему 'Multigrammatical modelling of neural networks'

Multigrammatical modelling of neural networks Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
0
0
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
neural networks / multiset grammars / multiset metagrammars / deep learning

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Igor A. Sheremet

This paper is dedicated to the proposed techniques of modelling artificial neural networks (NNs) by application of the multigrammatical framework. Multigrammatical representations of feed-forward and recurrent NNs are described. Application of multiset metagrammars to modelling deep learning of NNs of the aforementioned classes is considered. Possible developments of the announced approach are discussed.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Multigrammatical modelling of neural networks»

Multigrammatical modelling of neural networks

I.A. Sheremet1 1 Geophysical Center of Russian Academy of Sciences, 119296, Russia, Moscow, Molodezhnaya St. 3

Abstract

This paper is dedicated to the proposed techniques of modelling artificial neural networks (NNs) by application of the multigrammatical framework. Multigrammatical representations of feed-forward and recurrent NNs are described. Application of multiset metagrammars to modelling deep learning of NNs of the aforementioned classes is considered. Possible developments of the announced approach are discussed.

Keywords: neural networks, multiset grammars, multiset metagrammars, deep learning.

Citation: Sheremet IA. Multigrammatical Modelling of Neural Networks. Computer Optics 2024; 48 (4): 619-632. DOI: 10.18287/2412-6179-CO-1436.

Introduction

Multiset grammars (MGs) and multiset metagrammars (MMGs), introduced in [1, 2] and thoroughly described in [3], form a deeply integrated multigrammatical framework (MGF) being a mathematical toolkit and a knowledge representation model, originating from the theory of multisets [4] and suitable for solution of a wide spectrum of complicated problems from systems analysis, operations research and digital economy areas.

Investigating real capabilities of this relatively novel formalism, it would be reasonable to compare it by its descriptive power with formal systems already known in the modern computer science. Such comparison was done in [1, 2, 3], where Petri nets, systems of vectors additionsubstitution, and augmented Post systems were considered, as well as various classes of problems of the operations research, which interconnections with the MGF were studied; namely, it was demonstrated how specific problems formulated by means of the classical operations research toolkit would be represented by application of the MGF.

However, the aforementioned list would be definitely incomplete, if not to consider such widely applied and intensively developed artificial intelligence (AI) tool as artificial neural networks (4AAs) which for short will be referred below as neural networks (AAs).

This paper is dedicated to multigrammatical modelling of neural networks as a way of a comparative study of the MGF and AAs. Our approach is fully consistent with foundations of mathematical logic, where two classes of entities are considered - axiomatic systems (first order predicate calculus [5], Horn clauses [6, 7], grammars [8, 9], Post systems [10], augmented Post systems [11 - 13] etc.) and devices, usually considered as computational models (Turing machines [14], Petri nets [15], systolic structures [16], cellular automata [17], etc.), and the last enable more or less controlled and /or parallelized application of inference rules to input data for achieving objectives. Artificial neural networks from the early times [18, 19] were announced as a mathematical model of a

human brain and today are considered as a flexible computational model with a massive parallelism, so a lot of comprehensive neural-based solutions of various classes of complicated practical problems were designed and continue to be on search: computer vision, speech recognition, natural language understanding, radio signals processing, robots control, healthcare etc. [20 - 27]. The most attractive feature of NNs is their relatively simple learning from training data sets (TDSs) [28 - 33]. By this feature NNs are much more convenient in application than inference-based engines demanding on preparation and maintenance of large knowledge bases by experienced knowledge engineers. At the same time NNs are rather vulnerable to criticism on resilience to fluctuations in training data sets: to what extent would change a logic of a trained NN operation if some part of a training data set (in the simplest case, the only one training sample) would be replaced? And, at all, how representative is an applied TDS to create a neural-based device, applicable to any of situations which may occur in future, and would this device correctly operate in such situations? These and a lot of similar questions arise after acquisition of some experience in application of trained NNs, and not by the chance the most advanced scholars express their worry about possibility of the unpredicted behavior of an NN-basedAI [34, 35].

To deal with the whole spectrum of issues associated with NNs deep learning and post-training application, it would be rational to consider artificial neural networks not alone but regarding already known objects of mathematical logic and knowledge engineering, and some steps in this direction are already known: neural Turing machines as well as Chomsky grammars being a very peculiar examples [36, 37]. The cited papers demonstrate how NNs may be applied to model classical objects and thus prove their universalism in the sense of the theoretical computer science. Our paper follows the inverse direction: how axiomatic systems (namely, MGs and MMGs) may be applied in order to model NNs. Such approach may open some new research opportunities unavailable on the current device-based groundwork of NNs, and in this quali-

ty it may be assessed as some very modest contribution to primary logical foundations of neural networks.

As it will be shown below in the sections 2 and 3, any feed-forward neural network (FNN) may be represented by a multiset grammar implementing the same mapping from a set of possible input collections to a set of possible output collections of this FNN, and any recurrent neural network (RNN) - by a sequence of MGs with one and the same scheme and kernels being sums of a multisets, representing current steps inputs and previous steps feedbacks. As even more inquisitive result, which is described in the section 4, logics of deep learning of any FNN may be also modelled on a regular basis by a set of multiset metagrammars with multiplicities-variables, representing domains of possible weights of connections between NN nodes, and any such MMG is induced by one training sample. So a set of possible collections of the aforementioned weights, corresponding the whole training data set, is a result of intersection of similar sets, corresponding separate training samples. The most interesting result of this paper, considered in the section 5, is representation of logics of deep learning of RNNs by a sequence of one MMG, corresponding to the first step (the first training sample), and n-1 MGs, corresponding to the second and following steps (training samples). A set of collections of weights satisfying a whole data set is obtained from a result of the first step by exclusion such collections, which do not correspond at least one of the following n-1 training samples. Finally, possible developments of the considered approach to multigrammatical modelling of NNs are discussed in the section 6. The Appendix contains a short introduction to the MGF.

1. Multigrammatical representation of feed-forward neural networks

Any artificial feed-forward neural network [30 - 33] may be represented by an acyclic weighted oriented graph which in turn may be represented as a ternary relation

G c A x A x W, (1)

where A is a set of nodes (neurons), and W is a set of possible weights of nodes connections (synapses), so a, a,, WijeG means that a connection (synapse) from ai to aj has a weight w,. Logics of operation of an FNN, along with its topology, is determined by a vector H which components hi are threshold values, so if a sum of weights of active input connections of a node at is greater than hi then a node at is activated, and its output connections obtain the value 1. Such feed-forward propagation is done until an output layer which connections represent a result of operation of an FNN G, H. So, in fact, this neural network implements mapping from a set of binary vectors of values of input connections to a set of binary vectors of values of output connections. Let us construct some multiset grammar S (G, H) = vo, R which would implement the same mapping.

We shall include to a set of objects A of this MG as subsets a set A of nodes of an FNN G, H, a set Ain of its inputs and a set Aout of its outputs. Rules of this MG will be constructed as follows.

Let Aj = (a/,..., a'm } c A be a subset of set of nodes of a considered FNN, connected with a node at by his output connections; w{,...,w'm be weights of the aforementioned connections; and ht be an input threshold value of this node. We shall define for any such node a rule

{h • at-a},...,wm • am,}, (2)

and this operation will be done for all nodes aeA. Inputs will be represented by rules

{1 • • a,}, (3)

where ai is an input and a, is a node belonging to an input layer An c A (in a general case one input may be connected to several nodes but a node may be connected with the only input). Outputs will be represented by rules

{h • a,. }^{1- a,} , (4)

where a, is an output and ais a node belonging to an output layer Aout cA (we also allow that one node may be connected to several outputs but one output may be connected to the only node).

As it is acceptable in the MGF, values hi and wj may be any rational numbers [3].

Statement 1. Let Aout = (a/1,..., a,} cAout be a set of outputs of an FNN G, H activated by a set of inputs Ain = (a/1,., a/m} cAin, and S(G, H) =1*An,R where R is a set of rules defined by (2). Then

{1*Aoui}=Vs(G, H) ffi 1*A out (5)

Proof. As seen, a kernel of an MG S (G, H) is a multiset containing multiobjects 1a, where a^An. Following semantics of multisets generation, any rule with the left part {hi • ai} at any generation step would be relevant to a current multiset containing a multiobject h • at if and only if hi< h. From the NNs theory point of view application of a relevant rule to a current MS is equivalent to activation of a neuron at by an input which value h exceeds a threshold value hi of this neuron. From the other side, the aforementioned value would be a sum of multiplicities accumulated as a result of application of rules having multiobjects w • ai in their right parts. However, multisets generated by application of a scheme R would contain not only multiobjects which objects enter a set Aout, but also other multiobjects which multiplicities are not sufficient for relevancy (and thus application) of some one rule. From the other side, multiplicities of objects, entering a set Aout, may be greater than 1 due to possibility of multiple application of one and the same rules in an MSs generation process (this is equivalent to multiple activation of one and the same node, and such feature is in a general case possible in a multigrammatical model of an NN).

However, due to the fact, that a scheme R of an MG vo, R includes no more than one rule with the left part containing a multiobject a, a set Vs(g, h) generated by this MG, will contain the only TMS. Hence, a set VS(g, h) fi1*Ao„t in any case will contain the only terminal multiset which multi-objects are 1-a„ where ateAout. Returning to a modelled neural network, it means that this TMS represents nothing but a set of activated output nodes of this NN, i.e. Aout. ■

This statement confirms that a constructed FMG implements the same mapping from a set of values of inputs to a set of values of outputs as an initial NN.

Due to application of the most general basic graph representation of FNNs all the said is true for any particular case of such neural networks.

Example 1. Consider the multi-layer perceptron depicted in Fig. 1. This FNN contains the input layer (nodes a:, a2, a3), the hidden layer (nodes b\, b2, b% b4), and the output layer (nodes c\, c2).

Fig. 1. Modelled multi-layer perceptron's topology

Tab. 1. Input layer of modelled multi-layer perceptron

ai b1 b2 b3 b4

1 3 2 4

a2 b1 b2 b3 b4

1 5 1 1

a3 b1 b2 b3 b4

2 1 3 4

Tab. 2. Hidden layer of modelled multi-layer perceptron

b1 C1 C2

3 2

b2 C1 C2

1 1

b3 C1 C2

2 4

b4 C1 C2

3 1

Tab. 3. Threshold values of modelled multi-layer perceptron

a1 a2 a3 b1 b2 b3 b4 C1 C2

1 1 1 4 3 3 4 15 6

Weights of connections from the nodes entering the input layer to the nodes entering the hidden layer are presented in Table 1., the same data regarding the hidden and the output layers respectively - in Table 2., and the threshold values of all nodes - in Table 3. We use here integer values of weights for shortening a record; anyone who would desire to use rational numbers may apply 0. n instead of n (for example, 0.5 instead of 5).

According to (2) - (4), this FNN may be represented by the scheme R containing following rules, which names are divided from their bodies by the delimiter ":":

r :{•a1}^{1-a^, r2 :{•a2}^{1-a2}, r :{1-«3}^{1-a3}, r4 :{•aj}^{1 • bj,3• b2,2• b3,4• bA},

r,:{1-a2 b„5 • b2,1^ b3,1-K }, r6 :{•a3}^{2• b„1 • b2,3• b3,4• b4}, r :{4• bj}^{3• d,2• c2}, r :{3• b2c^bc2}, r9 :{3• b3}^{2• c,4• c2}, ri0 :{4• b4}^{3• c^,1 • c2}, rn :{15• a4},

rj2 :{6• c2} ^{1 • a5}.

Let the input nodes a1 and a3 are activated. Then the multiset grammar

S (G, H ) = {1 • aj,1 • a3}, R,

is equivalent to this FNN. Consider generation of the set of terminal multisets by application of the scheme of this MG to its kernel:

{1 • aj,1 • a3}: {1 • ai, 1 • a3}: {1 • a1,1 • a3}:

{1-b1,3 • b2,2 • b3,4 • b4,1^ a3}: {3 • b1,4 • b2,5 • b3,8 • b4 }: {3 • b1,1^ b2,5 • b3,8 • bi^^ c1,1^ c2 }: {3 • b1,1^ b2,2 • b3,8 • b4,3 • c1,5 • c2 }:> {3 • b^L b2,2 • b3,4 • b4,6 • c1, 6 • c2}:

r -> 10

{3 • b^L b2,2 • b3,4 • b4,6^ c1,6 • c2}:

{3 • b^L b2,2 • b3,9 • c1,7 • c2} => {3 • b^L b2,2 • b3,9 • c1,1^ c2,1^ a5} {3 • b^L b2,2 • b3,9 • c1,1^ c2,1 a5} }n (1* {a4, a5}) = {0 • a4,1 • a5}}.

As seen, the output as of the considered FNN, activated by inputs a1 and a3, will be activated as a response.■

We have applied the only sequence of rules because the order of their selection at any current step of genera-

tion is immaterial. A concerned reader may apply any other sequence to confirm the identity of obtained results.

Let us consider now the most general and powerful class of NNs, namely, recurrent neural networks.

2. Multigrammatical representation of recurrent neural networks

Any artificial recurrent neural network may be represented by an weighted oriented graph which has at least one cycle, i.e. a sequence of connections starting and finishing at some node of this graph [31, 32, 33]. Topology of any such network similarly to FNNs may be represented as a ternary relation (1), but an attempt to apply the same technique of multigrammatical representation of neural networks as above would fail because dynamics of RNN operation presumes not a single input-output step (finite impulse response, FIR) but "upon a time" operation including a sequence of such steps (infinite impulse response, IIR) in such a way that outputs of some neurons being a result of a previous step serve as inputs of neurons of an NN at the current step, and thus such outputs work as some kind of memory. To model such operation, we shall propose below some more sophisticated technique.

Consider a rule fa • at} —> • ,..., wm • am }, where some a) is an object representing a node belonging to some of previous layers already passed inside a current step of forward propagation initiated by activation of input nodes of a network. If we would try to model operation of such network without any changes regarding the FNN case, then we would obtain a cyclic multiset grammar generating in a general case an infinite set of responses given one input set. To avoid such senseless result we shall replace every object a) entering the right part of some rule and possessing a described above feature by a new object a) distinguished from a) and from all other objects. A set of such new objects called feedback objects will be denoted A+.

A multiset grammar S (G, H ) = vin, R, which is, due to the aforementioned transformation, acyclic and non-alternating, enables generation of a response Vout of a network at a current step in accordance with the Statement 1. At the same time objects, being elements of a set A+ and entering a set

Kr ,

enable transfer of information, obtained at a current step, to the next step of operation of a considered NN, and this is implemented by application of a new MG

S '(G ,H > = v;+v+, R, (6)

where v'in is an input coming at the next step, and

{v+} = Vn,R n N*A+. (7)

(By this technique we can select from a set of TMSs generated by an MG vn, R all multiobjects which objects

enter a set A+ because, let us remind, for any multiplicity n min{n, N}=n). We shall call a multiset v+ a feedback. As seen from (6)- (7), a generation step modelling the next step of operation of a considered NN starts from a kernel including new input information as well as information obtained at the previous step; the last may be applied as soon as multiobjects, representing nodes belonging to a recurrently activated layer, would appear in a generated multiset with multiplicities sufficient for application of proper rules (thus, for activation of corresponding nodes). Naturally, in a general case a number of such recurrently activated layers may be greater than one.

Now, generalizing (6) - (7), we may write equations determining a result of the i-th step of operation of a considered NN. It is obtained by application of an MG

St (G, H) = vn + v+"1, R, (8)

so

{vOut } = VSl (G , H )n {1*Ao, }. (9)

{v+ } = VSi(GH)n {N*A+}. (10)

As seen, v+_1 in (8) really works as a memory, enabling transfer of results, obtained at previous steps, to a current step.

Statement 2. An infinite impulse response of any artificial recurrent neural network G, H may be represented by application of a sequence of multiset grammars determined by (8) - (10). ■

A special proof of this statement is redundant because of the detailed description of logics of construction of the aforementioned sequence.

Example 2. Consider the recurrent neural network depicted in Fig. 2. This NN contains the input layer (nodes a1, a2, a3, two hidden layers (the first - nodes b\, b2, b3 - and the second - nodes c\, c2), as well as the output layer (nodes d\, d2).

Fig. 2. Modelled recurrent neural network's topology

Tab. 4. Input layer of modelled recurrent neural network

ai b1 b2 b3

3 2 1

a2 b1 b2 b3

1 4 3

a3 b1 b2 b3

2 1 4

Tab. 5. The first hidden layer of modelled recurrent neural network

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

b1 C1 C2

1 3

b2 C1 C2

2 2

b3 C1 C2

4 1

Tab. 6. The second hidden layer of modelled recurrent neural network

C1 d1 d2 b1 b2 b3

1 2 3 2 4

C2 d1 d2 b1 b2 b3

2 3 1 1 3

Tab. 7. Threshold values of modelled reCurrent neural network

a1 a2 a3 b1 b2 b3 C1 C2 d1 d2

1 1 1 3 4 5 8 4 11 9

As seen, this NN is recurrent because outputs of the nodes c1, c2 of the second hidden layer are connected to the nodes b1, b2, b3 of the first hidden layer. Weights of connections from the nodes entering the input layer to the nodes entering the first hidden layer are presented in Table 4., similar information regarding the second hidden layer and the output layer - in Tab. 6, and the threshold values of all nodes - in Tab. 7.

According to (6) - (10), this RNN may be represented by the scheme R containing following rules (here for simplification of a record we shall use bi for denotation of feedback objects):

r :{• —{1 • a1}, r :{• a2} —{•a2},

r :{• a3} — {1 • a3},

r^L a^ —{3 • b1,2 • b2,1 b3},

>5 :{• a2}^{1^¿1,4• b2,3• b3}, r :{•a3} —{2• ^1,1.b2,4• b3},

r7 :{3 • b1 {1 • c1,3 • c2},

r8 :{4• b2} —{2• c1,2• c2},

r :{5• b3}^{4• Cl,1• c2},

r10 :{•c1} —y{1 • d1,2^d2,3^b1,2^b2,4^b3},

r11 :{• c2} —y {2 • d1,3^ d2,1 b1,1• b2,3^ b3},

12 :{12• d1} — {1 • a4},

13 :{l1• d2}—•{•a5}.

Let the input nodes a2 and a3 are activated at the first step of the RNN operation. Then the multiset grammar

S1 (G, H ) = {• a2,1 • a3}, R},

models this first step enabling generation of the set of terminal multisets by application of the scheme of this MG to its kernel:

{1 • a2,1 • a3}: {1 • a2,1 • a3}:

r5

{1 • a2,1 • a3}:

{1 • b1,4 • b2,3 • b3,1 • a3 }: {5 • b2,7 • b3,4 • c1,1• c2}: {• b2,7 • b3,6 • c1,3 • c2 }: {• b2,2 • b3,10 • c1,4 • c2}

{• b2,2 • b3,2 • c1,4 • c2,1 d1,2 • d 2,3 • b1,2 • b2,4 • b3 }:

{• b2,2 • b3,2 • c1,3 • d1,5 • d2,4 • b1,3^ b2,7 • b3}: {1 -b2,2 -b3,2 •c1,1• d1,5 • d2,4 • b1,3 • b2,7 • b3,1 a4}. So, according to (9) - (10),

v\ut ={1 a4,0 • a5},

v|={4-¿1,3 • b2,7 • b3}.

As seen, the output a4 of the considered recurrent NN, activated by inputs a2 and a3, will be activated as a response after the first step of its operation, and the feedback of the first step will be {4 • b1, 3 • b2, 7 • b3}.

Now let at the second step of the RNN operation the input nodes a1 and a2 be activated. Then the multiset grammar

S2 (G, H ) = {1 • a1,1 • a2,4 • b1,3 • b2,7 • b3}, R,

models this second step enabling generation of the set of terminal multisets by application of the scheme of this MG to its kernel:

{1-a1,1 a2,4 • b1,3 • b2,7 • b3 }: {1-a1,1-a2,4 • b1,3 • b2,7 • b3}=i> {1-a1,1-a2,4 • b1,3 • b2,7 • b3}=i> {1-a2,7 • b1,5 • b2,8 • b3}=i> {8 •b1,9 • b2,11• b3} {5-b1,9-b2,11• b3,1• c1,3 • c2 } {2-b1,9 •b2,11• b3,2 • c1, 6 • c2} {2-b1,5-b2,11• b3,4 • c1,8 • c2} => {2-b1,1-b2,11 • b3,6 • c1,10 • c2 } {2-b1,1-b2,6 • b3,10 • c1,11• c2 } {2-b1,1-b2,1• b3,14 • c1,12 • c2}:

{2-M-M-cb12 • c2,1-db2 • d2,3-A,2 • b2,4 • b, }

{2-èb1-è2,1- • cb8 • c2,3^ db5^ d2,4 • йьЗ-b2,7 • b^

{2-èb1-è2,1- ^,6-cb4 • c2,5^ db8^ d2> Д,4 • b2,10 • b,} {2-èj,! è2,1-b,,6 • cb7 • db6 • b2,13^ b^b a5},

so

V 2

out

= {{0 * a4, 1 • a5 }}, = {6-¿1,5 • ¿2,13 • b,}.

As seen, the output a5 of the considered recurrent NN, activated by inputs ai and a2, will be activated as a response after the second step of its operation. The feedback of the second step will be {6 • bi, 5 • b2,13 • Ьз}. All following steps are executed in the same manner. ■

Now we shall consider key issues of multigrammatical modelling of NNs deep learning. A basic tool for this topic will be multiset metagrammars. Let us begin from feed-forward neural networks.

3. Multigrammatical modelling of feed-forward neural networks deep learning

We shall consider deep learning issues on the background of the above introduced representation of an NN as a couple G, H. Namely, instead of a weight we shall mark any connection by a unique variable, and a task will be, starting from a training data set (TDS) being a set of training samples input, output, to assign to these variables such weights which would satisfy this TDS, i.e. all training samples entering this set.

We shall represent a trained FNN by a scheme R of a multiset metagrammar including metarules

{ • ai }^{yi-a; rm, • <}.

(11)

where y) , i=1,..., m, is a variable which domain is |~0, N) ] , and N) is a maximal possible weight of a connection from an output of a node ai to an input of a node a) (by this we assume that in a general case any connection may have its own maximal possible weight). In the below considerations we shall operate a total set { y1,..., yM} of variables entering a scheme R and identified by lower indices (M = |G| is a number of edges of a graph G, i.e. a number of weights of connections in a modelled NN). Until it will be considered a general case, we assume, that threshold values of nodes are constants h.

Let a TDSbe T = \ A\n,At,...,An,An0ut}, where A\n is a set of input nodes activating a considered trained FNN whilst A'out is a set of its output nodes activated as a response of this network to an input Ain. We shall put in compliance with a training sample A'in, AOintt a multiset metagrammar

St (G,H) = 1*A«,R,F,

(12)

where

F =

( Gl '

U{0 <y* < Nk}

(13)

As everywhere above, a kernel of this MMG is a multiset containing multiobjects of the form 1 • a each such MO corresponding to one activated input of a considered trained NN. A filter of this MMG is a set of variables declarations 0 < y* < N* each defining a domain [0, N*] of a variable y*.

Evidently, a collection of weights of connections of this _ NN _represented by a multiset

w = {«1 •Уь...,nM •yM} V, where

S, (G,H )

satisfies a training sample A«, A'out, if VS,(G,H 1*A„„, ={1*Ao„,}.

(14)

In this case a whole set Wt of multisets, representing collections of weights of connections of a considered trained NN, satisfying a training sample Aiin,A'out, is nothing but

W = VSi (gh)П N*Г.

(15)

Now the task is to select from this set all TMSs which satisfy not only this one training sample but all training data set T. Evidently, a set Wt of collections of weights of connections of a trained NN satisfying all TDS, i.e. all training samples A1n,Aloul,...,An,A"out, would be a result of intersection of all sets W1,..., Wn'.

WT = f|W

(16)

_Let note once more, that a multiset

(n1 •y1,.,nM ^yM}eWT defines that the 1-th, ..., the M-th connections of a trained NN would have weights n1,., nM respectively. In a general case there may be | Wt| > 1 collections of weights satisfying a TDS. At the same time it is possible that Wt = {0}, that means a TDS is contradictory regarding a considered FNN, and some additional technique would be developed and applied to such case.

Until now it was presumed that threshold values of nodes were constants h. However, generalization of this case on a priori unknown threshold values is quite simple. It is sufficient to represent a trained NN by a scheme R of a multiset metagrammar including metarules

{r0 • at}^{yi-airm, • aL,}.

(17)

where variables y), i=1,..., m, have the same sense as in (11) whilst y'0 is a variable which domain is |~0, N0 ] , and N0 is a maximal possible threshold value of an i-th node. All the rest considerations are the same as above.

V

Statement 3. A result of deep learning of any feedforward neural network G, H by a training data set T = {{,A°ut,...,An,A"mt} may be represented by a set Wt determined by (16). ■

A proof of this statement is unnecessary due to the above detailed description of accumulation of a set Wt.

All the said was associated with feed-forward neural networks. Let us consider now a general case of recurrent NNs.

4. Multigrammatical modelling of recurrent neural networks deep learning

We shall assume that a complete training data set T = {An,Aloul,...,An,A"out} ,where n is a number of steps of operation of a trained recurrent neural network, is applied to it in such a way that the i-th training sample is associated with the i-th step of operation of this RNN. In order to make a proposed technique of modelling deep learning of RNNs more natural, compact and understandable we shall use not analytic, as above, but algorithmic representation of its logic. The last will be represented by a function RNNDL (Recurrent Neural Network Deep Learning) which inputs are a TDS T, a set R of metarules representing a trained RNN, and a filter F containing declarations of multiplicities-variables having place in the aforementioned metarules. An output of this function is a set Wt of satisfying a TDS T multiset-represented collections of weights of connections of a trained NN, i.e. satisfying all training samples A,1,,A°ut,...,An,Au entering this TDS.

We shall use in the text of the function RNNDL a filter Fi (in line 3 F as a particular case), which is defined as follows:

F, = F u

U { * !} u U { =

(18)

As may be seen, such filter enables selection of terminal multisets satisfying a set Au of activated outputs determined by the i-th training sample (we use a > 1 not a = 1 because of the possibility of multiple activations of outputs, which was discussed above in the section 3).

Also we shall use following variables in the text of the function RNNDL:

• v which current value is a terminal multiset generated by an MMG 1*A1„, R, F1;

• R which current value is a set of rules created by substitution of values of variables, entering a set v, to metarules entering a set R;

• v+ which current value is a feedback created as a result of the current step (in line 5 - from the first to the second step, and in line 9 - from the i-th to the i + 1-th, where i = 2,..., n-1);

• v which current value is a terminal multiset generated by a filtering multiset grammar

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

1*A + v+, R, F■.

The text of the function RNNDL is as follows.

1 RNNDL: function (T, R, F) returns (Wt);

2 Wt : = {0};

3 do v e F^ R F1;

4 R : = Rn(v n N*r);

5 v+: = v n N*A+;

6 do i e [2, n];

7 if 3v eV1*4,n+v+ M;

8 then v+: = v n N*A+;

9 else goto v#;

10 end i;

11 Wt : u{v n N*r};

12 v#:;

13 end v;

14 return (Wt);

15 end RNNDL

Let us comment this text in short.

At the very beginning (line 2) the variable Wt receives the initial value {0}. Accumulation of a multiset-represented set of collections of weights of connections of a trained NN is done inside the loop (lines 3 - 17) on the variable v which values, as it was mentioned above, are terminal multisets generated by application of a multiset metagrammar 1*A1„, R, F1. Its kernel 1*A1„ is a multiset representation of a set of inputs activating a trained RNN at the first step of training; its scheme R includes metarules like (17) representing this RNN; and its filter F1 determines terminal multisets, satisfying a set of activated outputs A1ut belonging to the first training sample. According to (14), every current value of the variable v includes a multiset {n1 •y1,...,nM •jM} representing a collection of weights of RNN connections satisfying a filter F1. (Evidently, in a general case a number of TMSs entering a set Va RF1 may be greater than 1). Because the aforementioned collection of weights must satisfy all training samples, a sequence of operations is executed inside the inner loop (lines 6 - 10) on the variable i, which values are numbers of training steps (from the second to the n-th). These operations enable check whether a current collection of weights, induced by a current value of the variable v, satisfies the current i-th training sample. A collection is included to the set Wt (line 11) only in the case when results of all executed checks are successful. Otherwise the external loop on values of the variable v continues (this is done by the jump operator goto v#, line 9); thus, a current "unsuccessful" collection of weights is not included to Wt.

It would be useful some additional clarifying comments to this general description.

As it was already said, a set of rules denoted R is created by substitution of values of variables entering a set v to metarules entering a set R (line 4). This operation is denoted n and is defined as follows:

R n{ •71,.,,m •Ym} = R 0 n1,., ,m , (19)

where operation ° is defined by (A.27), and, evidently, if

{1 •Y1,.,,m •Ym}v , (20)

then

{1 •Y1,...,,m •ym}=vnN*r . (21)

Since a multiset v includes a multiset v+ being a feedback, the next operator (line 5) enables selection of this submultiset by intersection of v and N*A+, where, remind, A+ is a set of feedback objects.

Every step of a loop on training samples (lines 6 - 10) from the second to the n-th includes the only conditional (if-then-else) operator. If a set V^+v+, R F is non-empty (this means that a generated terminal multiset v includes a set of multiobject representations of activated outputs coinciding a set of outputs of a training sample A'out) then a new feedback v+ to be used at the next step of the loop is created (line 8) by selecting from the MS v multiobjects containing feedback objects (this is done by intersection of MSs v and N*A+). Otherwise (i.e. no one TMS is generated because a set of multiobject representations of activated outputs summarized with a feedback v+ do not respond a set of outputs of a training sample Aout) a loop on numbers of training steps for the current multiset v is broken by the goto v# operator, and this jump enables continuation of the loop on the values of the variable v. If the loop on numbers of training steps (or, just the same, training samples) is successfully finished, this means that the current set of variables values (weights of connections of the trained RNN) satisfies the TDS and thus would be included to the resulting set Wt (line 12). After finishing the loop on v a final value of this variable is returned (line 14). Evidently, if no one successful execution of the loop on numbers of training steps had place, then Wt would remain the empty set.

Statement 4. A result of deep learning of any recurrent neural network G, H by a training data set T = {a1,,AL,...,An,Aou,} may be represented by a set Wt created by application of the function RNNDL.u

A proof of this statement is redundant due to the above detailed description of the function RNNDL.

So the case of RNNs deep learning is also covered without principal difficulties by the proper application of the multigrammatical framework.

5. Discussion

There are at least three possible directions of the MGF application to modelling not only artificial but biological neural networks (BNNs) with capturing some new features. The first one may cover physical growth of a brain from a baby to an adult and concomitant increasing of cognitive abilities of a human being which may be modelled by application of self-generating multiset grammars

[3]. The second is based on a possibility of combining in MG rules ordinary for artificial NNs topological-weights information with information on resources needed for brain operation and circulating inside a brain. The third is rather close to the second and concerns studying resilience of BNNs to possible destructive impacts, blocking some parts of a brain or/and depriving it some of necessary resources. Techniques developed for this task regarding resilience of sociotechnological systems [3,38] looks quite relevant for the beginning of this research.

Investigation of the aforementioned opportunities as well as further expansion of techniques of NNs multigrammatical modelling on a greater number of classes of neural networks will be a subject of future publications on this topic. No doubt, the three mentioned directions would be extremely useful for the development and enhancement of the MGF itself. And, naturally, the most advancing seem attempts of NN-based implementation of the MGF.

The author is grateful to Acad. Victor Soifer and Prof. Fred Roberts for a long-term support, as well as to the reviewer whose useful advices have definitely contributed to the quality of the final version of the presented paper.

Acronyms

AI artificial intelligence ANN artificial neural network APS augmented Post system BC boundary condition BNN biological neural network CBC chain boundary condition IIR infinite impulse response FIR finite impulse response FMG filtering multiset grammar FNN feed-forward neural network MG multiset grammar MGF multigrammatical framework MMG multiset metagrammar MO multiobject MS multiset

MV multiplicity-variable

NN neural network

RNN recurrent neural network

RNNDL recurrent neural network deep learning

STMS set of terminal multisets

TDS training data set

TMS terminal multiset

References

[1] Sheremet IA. Recursive multisets and their applications [In Russian]. Moscow: "Nauka" Publisher; 2010.

[2] Sheremet I.A. Recursive multisets and their applications. European Academy of Natural Sciences; 2011. ISBN: 9783942944120.

[3] Sheremet IA. Multigrammatical framework for knowledge-based digital economy. Cham: Springer Nature Switzerland AG; 2022. ISBN: 978-3-031-13857-7.

[4] Petrovskiy AB. Theory of measured sets and multisets [In Russian]. Moscow: "Nauka" Publisher; 2018.

[5] Ben-Ari M. Mathematical logic for computer science. London. Springer-Verlag; 2012.

[6] Kowalski R.A. Algorithm = Logic + Control. Comm ACM 1979; 22(7). 424-436.

[7] Lee KD. Foundations of programming languages. 2nd ed. Cham. Springer International Publishing AG; 2017.

[8] Davis MD, Sigal R, Weyuker EJ. Computability, complexity, and languages. Fundamentals of theoretical computer science. 2nd ed. Boston. Academic Press; 1994.

[9] Chomsky N. Syntactic Structures. The Hague. Mouton de Gruyter; 2005.

[10] Post EL. Formal reductions of the general combinatorial problem. Am J Math 1943; 65. 197-215.

[11] Sheremet IA. Intelligent software environments for information processing systems [In Russian]. Moscow. "Nauka" Publisher; 1994.

[12] Sheremet IA. Augmented post systems. The mathematical framework for data and knowledge engineering in network-centric environment. Berlin. EANS; 2013.

[13] Sheremet I. Augmented post systems. Syntax, semantics, and applications. In Book. Sud K, Erdogmus P, Kadry S, eds. Intraduction to data science and machine learning. Ch 11. London. IntechOpen; 2020. DOI. 10.5772/intechopen.86207.

[14] Hopcroft JE, Motwani R, Ullman JD. Introduction to automata theory, languages, and computation. 2nd ed. Boston. Addison-Wesley; 2001.

[15] David R, Alla H. Discrete, continuous, and hybrid Petri Nets. Berlin, Heidelberg. Springer-Verlag; 2010.

[16] Ullman JD. Computational aspects of VLSI. New York, NY. W H Freeman & Co; 1984.

[17] Schiff JL. Cellular automata. A discrete view of the world. Hoboken, NJ. John Wiley & Sons Inc; 2011.

[18] McCulloch W, Pitts W. A logical calculus of the ideas immanent in nervous activity. Bull Math Biol 1943; 7. 115-133.

[19] Rosenblatt F. The perceptron. a probabilistic model for information storage and organization in the brain. Psychol Rev 1958; 65(6). 386.

[20] Siegelmann HT, Sontag ED. Analog computation via neural networks. Theor Comput Sci 1994; 131(2). 331-360.

[21] Bragin AD, Spitsyn VG. Motor imagery recognition in electroencephalograms using convolutional neural networks. Computer Optics 2020; 44(3). 482-487. DOI. 10.18287/2412-6179-C0-669.

[22] Kalinina MO, Nikolaev PL. Book spine recognition with the use of deep neural networks. Computer Optics 2020; 44(6). 968-977. DOI. 10.18287/2412-6179-CO-731.

[23] Firsov N, Podlipnov V, Ivliev N, Nikolaev P, Mashkov S, Ishkin P, Skidanov R, Nikonorov A. Neural network-aided

classification of hyperspectral vegetation images with a training sample generated using an adaptive vegetation index. Computer Optics 2021; 45(6): 887-896. DOI: 10.18287/2412-6179-CO-1038.

[24] Acemoglu D. Redesigning AI. MIT Press; 2021.

[25] Andriyanov NA, Dementiev VE, Tashlinskiy AG. Detection of objects in the images: from likelihood relationships towards scalable and efficient neural networks. Computer Optics 2022; 46(1): 139-159. DOI: 10.18287/2412-6179-CO-922.

[26] Arlazarov VV, Andreeva EI, Bulatov KB, Nikolaev DP, Petrova OO, Savelev BI, Slavin OA. Document image analysis and recognition: a survey. Computer Optics 2022; 46(4): 567-589. DOI: 10.18287/2412-6179-CO-1020.

[27] Agafonova YD, Gaidel AV, Zelter PM, Kapishnikov AV, Kuznetsov AV, Surovtsev EN, Nikonorov AV. Joint analysis of radiological reports and CT images for automatic validation of pathological brain conditions. Computer Optics 2023; 47(1): 152-159. DOI: 10.18287/2412- 6179-CO-1201.

[28] Sallans B, Hinton G. Reinforcement learning with factored states and actions. J Mach Learn Res 2004; 5: 1063-1088.

[29] Salakhutdinov R, Hinton G. Semantic hashing. Int J Ap-prox Reasoning 2009; 50(7): 969-978.

[30] LeCun Y, Bengio Y, Hinton G. Deep learning. Nature 2015; 521: 436-444.

[31] Goodfellow I, Bengio Y, Courville A. Deep learning. MIT Press; 2016.

[32] Nielsen M. Neural networks and deep learning. Determination Press; 2019.

[33] Aggarwal CC. Neural networks and deep learning. Cham: Springer International Publishing AG; 2018.

[34] Bommasani R, Hudson DA, Adeli E, et al. On the opportunities and risks of foundation models. arXiv Preprint. 2022. Source: <https://arxiv.org/abs/2108.07258>.

[35] Metz C. "The Godfather of A.I." leaves google and warns of danger ahead. The New York Times 2023, 1 May.

[36] Graves A, Wayne G, Danihelka I. Neural turing machines. arXiv Preprint. 2014. Source:

<https://arxiv. org/abs/1410.5401>.

[37] Ackerman J, Cybenko G. A survey of neural networks and formal languages. arXiv Preprint. 2020. Source: <https://arxiv. org/abs/2006.01338>.

[38] Sheremet I. Application of the multigrammatical framework to the assessment of resilience and recoverability of large-scale industrial systems. In Book: Roberts FS, Sheremet IA, eds. Resilience in the digital age. Ch 2. Cham: Springer Nature Switzerland AG; 2021: 16-34. DOI: 10.1007/978-3-030-70370-7 2.

Appendix A. Filtering multiset grammars and multiset metagrammars

A multiset (MS) is defined as a collection of multiobjects (MOs) consisting of indistinguishable elements (objects) [3,4]. A multiobject containing n objects a is denoted n • a, and n is called a multiplicity of an object a. (Below we shall use small symbols "a", "b", "c" etc. with or without lower indices for objects denotation; multisets will be denoted by small "v" with or without indices, as well). A record

v = • a1,...,nm • am} (A.1)

means that an MS v contains n objects a1, nm objects am. We shall use a symbol "e" for denotation that an object or an multiobject enters a multiset v, so at e v means that an object ai enters an MS v as well as n • ai e v means that a multiobject ni• ai enters this MS. From the substantial point of view a set {a1,..., am} and a multiset {!• a1,..., 1- am} are equivalent, as well as an object a and a multiobject 1a. The empty multiset and the empty set both are denoted as {0}.

If a multiplicity of an object a is zero, it is equivalent to an absence of a in a multiset v, what is written, as usual, a v. If an MS v is determined by (A.1), then a set P(v) ={a1,..., am} is called a basis of a multiset v.

Here in this paper we shall use two known relations (inclusion c and strict inclusion c) and five known operations on multisets [3] - addition +, subtraction -, multiplication by a constant *, join u and intersection n - as well as two new operations, which will be applied below to multigrammatical modelling of neural networks.

Operation of multiset creation from a set is similar to the operation of multiplication of a multiset by a constant, but one of its operands is a set not multiset, so we shall denote this operation by the same symbol *. It would be clear what namely operation is applied from what namely operand is used - a set or a multiset. (Such way of operations denotation is common for modern programming languages). Semantics of multisets creation is as follows:

{a1,...,am}* n = n*{a1,.,am} = {n1 • a1,.,nm • am}. (A.2)

Evidently, for any set A and any integer number n it is true p (n*A) = A. Example 1.

{a,b,c}*3 = 3*{a,b,c} = {3 • a,3 • b,3 • c}. ■

Operation of intersection of a set of multisets by a set is denoted and is defined as follows:

{,...,vn}n v = { n v,...,v„ n v}. (A.3)

This operation is very convenient for selecting sub-multisets from multisets. Due to definition of multisets intersection [3] as

v n v'= U {min {n,,'}• a} (A.4)

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

n-aev n'^aev' aep(v)np(v')

it is quite simple to select objects, entering a set x, from a multiset v by applying

v n (1* x), (A.5)

or, taking into account priority of operations (multiplication has a greater priority than intersection), without brackets v n (1* x). (A.6)

In this case, due to min{n,1} = n for any non-zero integer multiplicity n, a result will be {1 • a1,..., 1am}, where {,..., am } = p(v )np(x). (A.7)

From the other side, not more difficult is to select multiobjects, which objects enter some predefined set, along with their multiplicities. For this purpose a constant N representing some maximal value, which is greater than any multiplicity in a concrete implementation of the multiset algebra, may be used. In this case

v n N *x (A.8)

would be applied, and due to min{n, N}= n for any multiplicity n, a result will be {,1 • a1,..., nm •am} , where

x ={a1,... , am}.

Example 2. To check whether objects a and b enter multisets belonging to a set

V = {{2 • a,3 • c},{4 • b,8 • c}},

operation V n 1*{a, b} may be used, and the result will be {{1 • a}, {1 • b}}.

To select from this set of multisets their submultisets, which basis is {a, c}, it is sufficient to apply operation v n N*{a, c}, obtaining {{2 • a}, {3 • c}}. ■

A multiset grammar is a couple S=v0, R, where a multiset v0 is named a kernel, and a finite set of rules R is named a scheme. A set of all objects used in a kernel and a scheme of an MG S is denoted As. A rule r e R is a construction

v ^ v', (A.9)

where multisets v and v' are named respectively the left part (v^ {0}) and the right part of a rule r, and is a divider. If v c v , then a result of application of a rule r to a multiset v is a multiset

V = V - V + V

(A.10)

Speaking informally, (10) defines, that if the left part of a rule, i.e. a multiset v, is included to an MS v , then v is replaced by the right part of this rule, i.e. a multiset v. In this case a rule r is called relevant to a multiset v. A result of application of a rule r to a multiset v is denoted as

v=^v', (A.11)

and it is said, that an MS v is generated from an MS v by application of a rule r.

A set of multisets, generated by application of a multigrammar S = v0, R, or, just the same, determined by this mul-tigrammar, is recursively created as follows.

V(o) = {vo }'

Vi+1)= Vi )U

Vs = vw.

uu

v ^ v

(A.12) (A. 13) (A.14)

As seen, a set VS includes all multisets, which may be generated from an MS v0 by the sequential application of rules r e R , and VS is a fixed point of a sequence

V0) V) ,•••,Vi),•••,

so

Vs = u Vi).

(A.15)

In a general case a set VS may be infinite.

If an MS v' may be generated from an MS v by application of some sequence (chain) of rules entering a scheme R, it is denoted as

R

v ^v'

and, if so, then

Vs = |v

R

vq ^ v

(A.16)

(A.17)

A multiset v eVS is called a terminal multiset (TMS), if no one rule reR is relevant to this multiset, i.e.

(v(v — vi)eR) -(vc v). (A.18)

A set of terminal multisets (STMS), determined by a multiset grammar S, is denoted VS . Any STMS is a subset of a set of all multisets defined by an MG S.

Vs C Vs .

Example 3. Let the MG S=vo, R, where the kernel is vQ ={3 •( rur ),4 •(usd ),2 -(eur )}, and the scheme R ={n, r2}, where, in turn, the rule n is

{3 -(eur )}{4 -(usd )}, and the rule r2 is

{2 - (usd),3 - (rur)} ^ {2 -(eur)}.

(A.19)

As seen, the initial collection of currencies includes 3 Russian Rubles, 4 US Dollars, and 2 Euros; the scheme of this MG represents actual regulations for currencies exchange (3 Euros may be exchanged to 4 US Dollars, 2 US Dollars and 3 Russian Rubles may be exchanged to 2 Euros). In accordance with definitions (1) - (9),

V(0) = {{2 • (eur ),4 •(usd ),3 • (rur )},

V(o) •{{•(usd),4•(eur))}, V(2) = •(usd ),L(eur ))} = Vs .

As seen, this MG enables generation of all possible collections of Euros, US dollars, and Russian rubles, which may be obtained from the initial collection vo by sequential currency exchanges, which parameters are fixed by regulations represented by the rules n and A set of terminal multisets VS generated by this MG contains the only TMS {l-(eur), 6-(usd)}.m

Filtering multiset grammars (FMGs) are such extension of MGs, which semantics presumes two sequential operations - generation of a set of terminal multisets by application of a scheme to a kernel (step l), and selection from it such TMSs, that satisfy some restrictions (conditions), expressed by a so called filter (step 2).

A filter is a set of conditions, and a multiset satisfies a filter if it satisfies all conditions entering it. Conditions may be boundary and optimizing. Here in this paper we shall use only boundary conditions (BCs).

A boundary condition is recorded as a6n or n6a, where 6 e {>, <, >, < =}. A multiset v satisfies a BC a6n, if m-aev and m6n is true, and satisfies a BC n6a, if m-aev and n6m is true (in both cases aiv is equivalent to 0-aev). In a general case so called chain boundary conditions (CBCs) recorded as n6a6'n' may be applied, any of such BCs being equivalent to two boundary conditions: n6a and a6'n'. A result of application of a filter F to a set of multisets V is denoted Vi F.

Example 2. Let us consider the set of multisets

{l-(eur ),6 -(usd )J,

V = <! {4 -(usd ),3 -(rur )}, {7 - (eur), l - (usd) ,5 - (rur )J

and the filter

F = {(usd)< 5, (rur)> 3J .

Then

V i F = (V i {(usd) < 5J) n(v i {(rur ) > 3 J) = {{4 - (usd), 3 - (rur )J, {7 - (eur ), l - (usd), 5 - (rur ) J. m

A filtering multiset grammar is a triple S = vo, R, F, where vo and R are, as above, a kernel and a scheme, while F is a filter, including conditions, defining multisets, which would be selected from a set of TMSs, generated by an MG vo, R, i.e.

Vs = Vvo,R i F. (A.20)

Verbally, Vs is a subset of Vvo R , which includes only such elements of this set, which satisfy a filter F.

Example 3. Let us consider the FMG S=vo, R, F, where the kernel vo and the scheme R are the same as in the Example l, and the filter

F = {(eur )> 2, (usd )> 3J.

Applying this filter to the set of terminal multisets Vvo R generated by the MG vo, R, one solves a task of selecting such collections, obtained by proper exchange chains, which would contain not less than 2 Euros and not less than 3 US Dollars.

According to (20),

Vs = Vvo,R i F = {0J,

that means no one collection satisfies the filter F. m

A multiset metagrammar S is a triple (v0, R, F), where v0 and F are, as above, a kernel and a filter respectively, and a scheme R contains, along with rules, also metarules.

A metarule has the same form as a rule

{(0.1 • al,..,^m • am} — (iV-a1',...,|i„ '• a„'}, (A.21)

but any |i, 0/ may be not only a positive integer number, as in MGs, but also a variable y e r, where r is an universum of variables. If o or is a variable, then it is called a multiplicity-variable (MV). As seen, a rule is a partial case of a metarule, which all multiplicities |i,..., |im, |1,..., ' are constants.

A filter F of an MMG S=(v0, R, F) is a set of boundary conditions, as in FMGs. At the same time F includes chain boundary conditions of a form

n <y< n'. (A.22)

There is one and only one CBC (A.22) for every variable y having place in at least one metarule entering a scheme R. This CBC is called a variable declaration and determines a set of possible values (domain) of this variable. If F includes a subfilter

Fr ={n1 <y1 <n1,..., n, <y, <n,} (A.23)

containing all variables declarations, then every tuple n12..,n,, such that n1 e [n1, n1 ],...,n, e [n,,n,] , enables creation of one filtering multigrammar by substitution of n1,., n, to all metarules, entering a scheme R, instead of multiplicities-variables. Rules, entering R, are transferred to a new scheme denoted

R ° n", — , n (A.24)

without any transformations. Every such FMG generates a set of terminal multisets by application of a filter T = F - Fr T = F - Fr, which contains all "usual" conditions, which donot include variables. Finally, an MMG S = v0,R, Fdetermines a set of terminal multisets Vs in such a way.

V = T, (A.25) S* = u U i"0 +{n° 'y°.....1 j. (A.26)

n1e[n1,n1] n, e[n ,ni ]l R ° n1,..., I

R ° n1,.,ni = (r ° n1,.,n,| r e R}, (A.27)

T = F - Fr, (A.28)

Fr = U{ <yj < nj}, (A.29)

j=1

where y1 ,..., y, are auxiliary objects, used in such a way, that a multiobject nj •yj, j = 1,...,l, represents a value nj of a variable y,-. As seen, due to (A.25) - (A.29) an MMG S=v0, R, F generates terminal multisets of a form

{ • ii^...,nk • ak ,nj1 •yL.,nji -y,}, (A.30)

and this feature is useful for multigrammatical modelling of deep learning neural networks.

As seen, MGs are a multiset-operating analogue of classic string-operating grammars introduced by N. Chomsky [9] whilst MMGs due to use of variables are some analogue of Horn clauses operating atomic formulas of the first-order predicate logic [6, 7], as well as Post systems [10] and their generalization - augmented Post systems (APSs) [11, 12, 13] - operating strings. A principal feature distinguishing MMGs from Horn clauses, Post systems and APSs is that in the last three an area of actuality of any variable is a specific clause or production (S-production) to which this variable belongs, whilst in MMGs this area is an entire scheme (a set of rules). Let us illustrate the definition (A.25) - (A.29) by the following example.

Example 4. Consider the MMG S=v0,R, F, where v0 ={1 • a}, and R contains three metarules, including multiplicities-variables x and y.

r1 . {1 • a} — {2 • b, x • c},

r2. {b,bc} — {y• d},

r . {1-b,y • c} ^ {y • d},

whilst the filter F contains the following conditions.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

c < 2, d > 1, 1 < x < 2, 0 < y < 1,

the last two CBCs being the declarations of the variables x and y. According to (A.25) - (A.29), the scheme S determines four FMGs:

51 ={1-a,1-x},R o1,0,

52 ={1-a,1-x,1-y},R o1,1,

53 ={1-a,2 - x}, R o 2,0,

54 ={1-a,2 - x,1-y}, R o 2,1,

and the filter T = {c < 2, d >1}. As seen,

R1 = Ro1,0 = {{1 - a} ^{2 -b,1 -c}, {1 -b,1 -c}^{0}, {1 -b}^ {0}}, Vs1 ={{1-x},{1-c,1-x}},

R2 = R o1,1 ={{1 - a} ^{2 -b,1 - c},<1 -b,1 -c}^-{1 - d}}, Vs2 ={-b,1-x ,1-y},{1-d,1-x ,1-y}},

R3 = Ro2,1 = {{1-a} ^{2-b,2-c}, {1-b,1-c}^{0}, {1 -b}^{0}}, VS3 ={{2 - x},{1-c, 2 - x},{2 - c, 2 - x}}, R4 = R o 2,1 = {{1 - a} ^{2 - b,2 - c}, {1-b,1-c}^{1-d}}, VSt ={2 - d ,2 - x ,1-y}}.

According to (A.25),

{1-x }, {1-c,1-x},{1-b,1-x ,1-y}, {1-d ,1-x ,1-y}}2 - x },{1-c, 2 - x }, {2 - c, 2 - x}, {2 - d ,2 - x ,1 - y}

¿{c < 2,d > 1} = {-d,1 -x,1-y},{2-d,2 -x,1 -y}}.

Vs = ( u Vs2 u Vs3 u Vs4 ) i {c < 2, d > lJ =

Authors' information

Igor A. Sheremet. Geophysical Center of Russian Academy of Sciences, Moscow, Russia. E-mail: sheremet@rfbr.ru Received October 04, 2023. The final version - November 01, 2023.

i Надоели баннеры? Вы всегда можете отключить рекламу.