Docsity

Artificial intelligence Buscema Iulm, Dispense di Tecniche Di Intelligenza Artificiale

Toggle sidebar
bg1
ARTIFICIAL INTELLIGENCE
Maths is built with two components: imagination and demonstration
If you are not able to imagine you are not a mathematician. Imagination is much more important than capability of
demonstration.
What AI is?
AI aims to make thinking automatic. We have learned to make material procedures automatic: the engine, the laser,
the physical and chemical chains of matter and energy. But thought is different: thought doesn’t have mass (you
cannot weight it), it is invisible (most of the time our speech doesn’t represent our thought). Yet even without mass,
thoughts attract each other (when you have a thought you come up immediately with another thought). Thought
seems to be a word born in the plural.
Natural Computation and Artificial Intelligence
We try to make automatic thoughts in different ways. We have 3 branches of AI:
- Bio-engineering approach → I’m interested in understanding in how human brain works.
Why do I need to rebuild on computer a brain if I want to study human brain? If you want to understand you
must be able to decompose it and then to rebuild all the components together.
- Computer science approach → emulation of human brain. I want to build a pc much faster, more efficient
than human brain. I try to study tricks of human brain; I implement them in the computer, and I try to build a
much more efficient device. I use human brain as a bank of ideas
- Physic Approach → inspiration at human brain to understand how local behaviour is transformed
spontaneously in global. We must understand how all components work together, so how their local behaviour
can be turned into a global behaviour. It tries to understand the rules through which we pass from a local
behaviour to a global/collective behaviour.
Reductionism -> take a process, find out the small pieces which compose it, analyse them, describe how it works. This
approach is not complete, since if we understand how each micro components work, we don’t know how they work
together. You have to understand how components work together and how a global model emerges from the local
interactions of the components.
Artificial Adaptive Systems and Artificial Sciences
This graph shows how scientists work usually.
Natural and cultural processes → I have to understand the rules through which the process exists by using maths
An equation has two different points from which to observe the same phenomenon. Y = X → y is equal to x. The same
quantity from two points of view. So, equation is a frozen thought, I need to freeze the concept since I cannot recap
from the beginning anytime if I want to go on. Therefore, maths is a series of frozen thoughts.
Formal algebra -> the fundamental thought on which the process is based on, I try to grasp from the process that I
want to understand the invariants. To understand if my equation is right, I need a validation process -> a process that
everyone is able to repeat
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Anteprima parziale del testo

Scarica Artificial intelligence Buscema Iulm e più Dispense in PDF di Tecniche Di Intelligenza Artificiale solo su Docsity!

ARTIFICIAL INTELLIGENCE

Maths is built with two components: imagination and demonstration If you are not able to imagine you are not a mathematician. Imagination is much more important than capability of demonstration. What AI is? AI aims to make thinking automatic. We have learned to make material procedures automatic: the engine, the laser, the physical and chemical chains of matter and energy. But thought is different: thought doesn’t have mass (you cannot weight it), it is invisible (most of the time our speech doesn’t represent our thought). Yet even without mass, thoughts attract each other (when you have a thought you come up immediately with another thought). Thought seems to be a word born in the plural. Natural Computation and Artificial Intelligence We try to make automatic thoughts in different ways. We have 3 branches of AI:

  • Bio-engineering approach → I’m interested in understanding in how human brain works. Why do I need to rebuild on computer a brain if I want to study human brain? If you want to understand you must be able to decompose it and then to rebuild all the components together.
  • Computer science approach → emulation of human brain. I want to build a pc much faster, more efficient than human brain. I try to study tricks of human brain; I implement them in the computer, and I try to build a much more efficient device. I use human brain as a bank of ideas
  • Physic Approach → inspiration at human brain to understand how local behaviour is transformed spontaneously in global. We must understand how all components work together, so how their local behaviour can be turned into a global behaviour. It tries to understand the rules through which we pass from a local behaviour to a global/collective behaviour. Reductionism - > take a process, find out the small pieces which compose it, analyse them, describe how it works. This approach is not complete, since if we understand how each micro components work, we don’t know how they work together. You have to understand how components work together and how a global model emerges from the local interactions of the components. Artificial Adaptive Systems and Artificial Sciences This graph shows how scientists work usually. Natural and cultural processes → I have to understand the rules through which the process exists by using maths An equation has two different points from which to observe the same phenomenon. Y = X → y is equal to x. The same quantity from two points of view. So, equation is a frozen thought, I need to freeze the concept since I cannot recap from the beginning anytime if I want to go on. Therefore, maths is a series of frozen thoughts. Formal algebra - > the fundamental thought on which the process is based on, I try to grasp from the process that I want to understand the invariants. To understand if my equation is right, I need a validation process - > a process that everyone is able to repeat

Automatic Artificial Models - > I have to test if my equations, frozen thoughts have a good background, are true. I put some data from the process in the program and I check the output, how the output is similar or different from the process I want to understand. So, I make a comparison. Classic Computation VS Natural Computation We can do the process showed before in two different ways:

  • Classical computation : experts try to understand the most important rules of the process. According to the rules, I try to write equations, I implement the equations in the program, I run the program and I compare the outcome. But this way works only if the process follows a priori rule that is defined from the beginning before the process. I apply the same rule during the process up to the end. I apply the rule to the data, and I test, validate the results. This approach is like selecting one random frame to give an idea of a movie, but it is not possible. The single components of this process have already had all the info for the entire process. Permutation: I can compose the units in any possible way. D = N (N - 1)/2 - > N is all the cities. N – 1 since the distance between one city and itself is zero. Divided two since the distance between city 1 and city 2 is the same to the distance between city 2 and city 1. This means that in any single piece there are all the info to build up the entire.
  • Natural computation : a system that invents rules dynamically. I divide the process in small pieces and each piece interact through some equations with the neighbour, this local interaction will produce a global effect that is completely not predictable from the local interaction. There are systems which create rules while they are working so we have no chance to describe the rules before the beginning. The information along the time increases. A System is a compact region into the space-time. A System Dynamics is generated by the local and parallel interaction of its atomic components trough the time. The apparent rules governing these dynamics are simply one of the effects of the dynamics itself through the time.
  • Complicated systems - > they don’t produce new info during their work, time produces an increase of noise. The disorder increases all the time for each artificial system. Entropy law - > the usage of the components over time makes them less functional and increases over time. They follow the same rules from the beginning, but after a while the system works you have to make reorganization and order es. airplane
  • Complex system - > it’s a system that adapts itself at the environment in time and, at the same time, adapts the environment at its objectives, so it is and adaptive system. It is a system that creates rules along its working. Its adaptation needs to create local rules according to the needs. Time is not a noise, time is an opportunity to evolve, an evolutionary parameter. A system is complex when its global dynamics is unpredictable by a local point of view and when this dynamics is not equal to the summation of the dynamics of its components. Human - > an organism is complex, but to some extent also complicated, since some part of us is subject in time.

Artificial adaptive systems work in a similar way to natural adaptive systems. Two kinds of artificial adaptive systems:

  • Evolutionary systems : I have the rules and I find out the data that constitute the rules, from the constraints to the data, from the constraints you try to find out the data that respect all the constraints
  • Artificial neural networks : systems that see the data and find out the rules. Two kinds of neural networks: Supervised - > I have independent variables at the beginning and at the end I have a target. I divide randomly the set of data into two halves: training set and testing set. I take a neural network and I train it to understand the relationship between input and target, how the different inputs are associated with the different targets. After that the network has learnt, meaning that as I show the inputs to the network it immediately knows the answer, I stop the learning. Then I take the testing set without training it and at the end you know in blind way how many records the network will be able to judge correctly. So, I know the target, I train the network toward the association with the inputs and the target, it makes the association, I test in blind way the capability of the network to have captured the features Unsupervised - > I have only the variables, I don’t know the target, I would like to know how each variable is associated with any others. I use a “what if” analysis, I imagine. APPLICATION Science targets
  1. Making visible what is hidden
  2. Finding out the invariants explaining the contingencies - > there are rules which explain all the variations which appear to be random Artificial neural network looks the data many times and evolve the weight metrics in order to learn from the data, the current knowledge present in the data. Artificial neural networks try to represent the environment and to select the main pictures that represent the environment, this network previews an internal representation of data. We are able to simulate a learning process, a process in which an artificial network sees many times the same data and each time it updates its connections in order to understand the data itself. An algorithm sees the data, applies some equations, and generate the solution. The algorithm sees many time the same data and each time it applies the connections between its internal nodes es. like a baby who sees a new environment for the first time, he looks at the environment many times and at each time he understands something more and up to the end he has an internal representation of the environment. But if you change some part of the data, the network will update in different ways and that is important since you have learning along the time. So, time is not a waste, but a useful time, because during the time the system improves its knowledge of the data. The network sees the data many times and each epoch/cycle it adds some features. How can we get this kind of results? A neural network is composed at the minimal level of nodes and weights. The weights are the links among the nodes. Each link adds a value that precise the strength of the association between two nodes. Weight means link with a value. The value can be ranged between plus (+) infinity and minus (-) infinity, positive and negative. During the learning process the network will update the strength between the nodes, so the weights values. Putting together nodes and weights we have networks. How does it work? Signal flow - > It works specifying in which way each signal from the input comes up to the output After that the signal flows from the input to the input, how are the different ways updated? According to the learning law, each weights update their value according to the input that come to the output. When we have different artificial networks working together, we have an organism.

ARTIFICIAL NEURAL SYSTEMS: STRUCTURES

DEEP STRUCTURE: Nodes and Weights To calculate how this node reacts. Each input nodes are linked into the destination node. The value of each input is scaled between 0 and 1. We need to scale every variable between 0 and 1 linearly, maintaining the same proportions in order to be able to compare how the different variables act on the output. G is the graph; G is a function/composition of Nodes (N) and Weights (W). Node is a composition of an input, a state, an output (how it reacts). How can we calculate the output of a generic node? Each small circle is an input node and each of them can have a value between 0 and 1. 1 is the top, 0 is the minimum. At the beginning we generate random weights between input and nodes, I set each weight with a random value. Input : the sensor of the node State : internal state of the node Output : reaction of the nodes to this input Red line : weights Calculate the global input/final strength arriving to the destination node from the external inputs: it is similar to the total force pushing someone. A node is a person, this person is pushed away from different people, the global force is the sum of all the people pushing it away. But it can happen that a single person pushes with strength, and this correspond to the weight. Net input → global input arriving to each node. The first input value of node times its weight + the second value of node times its weight and so on. At the end I have a sum of the input weighted, the final strength, a number which could be positive or negative. This number is named Net Input, which depends on the external inputs and the weights. Inside I must calculate how the node is deformed by these forces arriving from outside according to the state of the node itself es. if it is a rock, it will be slightly deformed, if it is plastic, it will be highly deformed.

  1. Deep Feed Forward : a network where all the nodes are segmented in layers, the node belonging to a layer share the properties, but the properties of a node of one layer are different from the properties of the node of another layer. The nodes of a layer (1,2,3,4,5) have weights/links with all the nodes of the next layer but not among them and the first node of the H1 level receives the link of the previous layer and send the link to any other node of H2 layer and the same is for the P layer. Es. A dataset of students with different characteristics - > Each student has 50 features named variables since they vary for each person, we build up a network of 50 inputs/nodes, then we scale linearly each variable between 0 and 1 in order to make the different variables comparable. First process - > The scaling is called pre-processing. Second process - > I set each input node with the value of each variable. The first layer (N) is the input layer and I set up the value of the first variable and so on, at the end if I have 50 variables in the dataset, I’ll have 50 nodes. Each node in the hidden layer, which is inside the network where the network tries to represent the different network it is receiving. Calculate the added value of each hidden node H1 - > 1 times its weight, 2 times its weight and so on. It is similar to what happens to the brain when you have different neurons and when you receive and input from the outside these neurons connect each other and change information each other in very similar way. If I set randomly the first weight, the first output will be random. Supervised process - > The network learn which students will pass exam and who fail, I have the characteristics of each student and in the dataset, I want that the network learns an association between characteristics of students and final exam. I put the first student, N = 50, H1 layer and H2 layer I define how much they have to be (big or small), but the P layer (output layer) has to be 1 - > 1 pass 0 fails. Redundancy: more words than info, repeat in different ways the same concepts. I represent the exit not with one node but with 2 nodes, so 1 0 pass 0 1 fails. 0 in math is not a normal number, each number times 0 is 0. The info is more explicit if I add 0. So, there are two outputs: 1 0 and 0 1. 50 - > I calculate the net input of H nodes - > output, I do this process for each layer. The network at the end will say 0.3 and 0.5 in the two groups (pass, fail), it is a random answer. I calculate the difference between the first node output and the second, I calculate the delta es. 1 – 0.3 = 0.7. I will communicate this error to the other weights connecting the layer H to the P layer and I change each weight of a delta, a manipulation of this delta. The weight 1 2 is from 1 to 2, at the next step it will be equal to the weight 1 2 + delta, I add to the previous value of the weight a delta value, I update each weight from the input layer to the output layer. Then I backpropagate the error signal up to the input and I update any weight from the input layer to the H1 layer. Recap: I calculate the output using random weights, I calculate the errors in each node, using this error I update from the output up to the input all the wight of a different delta according to a mathematical rule. Error back propagation: propagate the error from the output back to the input. Four processes: data presentation ; signal flow from input to output ; delta calculation ; updating the wights. After these 4 phases the network has concluded a CICLE. When I do all this process for each layer the network has concluded an EPOCH. The process for one student is called CICLE , the process for all students is called EPOCH.

Design of the Architecture of a Network

  • Topology - > if I have a dataset with 3 variables, I have 3 input nodes. Input and output topology is defined by the problem. The number of the hidden layers and the number of the nodes for each hidden layer is decided by the user. Deep neural networks - > the number of the hidden layer are much bigger than 2. Each layer interprets the previous one, so you have a cascade correlation of interpretation and going to the output there is an increasing of abstraction of the networks
  • Signal flow
  • Learning rule - > according to which mathematical rule are added weights EXAMPLE: Flowers For each flower there are four variables (first four columns): the length of the petal, the width of the petal, the length of the sepal and the width of the sepal. The outputs are the last three columns, three kinds of Iris. The network has to learn which flower belong to the class 1, 2 or 3 only seeing the inputs/variables. We have 4 inputs/variables and 3 outputs/classes. I divide this dataset in two random set, I will use one set for learning (training phase) and the other for testing. I show only inputs to testing set, not the target in order to understand how much the network is able to predict the classes without knowing the target. Rote means square error - > the quantity of error we used to measure during the training, the average error. Each epoch has seen all the 75 flowers and for each flower it has calculated the workflow in output, the error and the corrections of the weights. We expect that this error will decrease slowly up to zero along the epochs. How weights modify themselves dynamically in red colour when a weight connection becomes very inhibitory, in green when a connection becomes very excitatory After the training I can know how each input takes part in the learning. How each hidden nodes modify themselves during the learning. If we know exactly the number of the hidden layer needed for a task and how many hidden nodes for any task, we don’t need a neural network as we already know the mathematical function The more hidden nodes we have, the easier will be for the network to learn. The more layers we have, the higher the capability of abstraction/complexity. We need a network able to understand the complexity of the dataset not to overestimate the complexity → trial error program. But if I create too many nodes, the network learns too much, and it risks having a fantasy and he can classify in the wrong way cause it thinks too much.
  1. Intermediate Structure ACM : each node is different from the others. It is a photo, we transform each pixel in an input node, it is an iconic picture so you cannot make permutations. Each pixel (input) is linked through weights with a pixel (input) surrounding

understand which genes are more responsible of the disease. But clustering is not easy. If I visualize the dataset, the big numbers are toward white. If I want to make clusters, don’t refuse the equation. If I want to measure the energy of the dataset, the more the energy is small, the more the dataset is clustered. If I want to cluster that means that I want that the neighbourhood of each cell present similar number to the central cell: the more the similarity, the more the clustering. If I want to calculate the clustering, I want to apply the equation. I have to repeat the equation many times since if I swap one column with another one, I change the neighbourhood of each cell, so I have to recalculate as the number of energies could be lower or bigger. How many permutations do I need to do? The number of permutations is much bigger than the number of electrons existing in universe. So, I’ll use an evolutionary system that will try to understand which permutations are fundamental to cluster in the better way this dataset. Take the photo, randomize the columns and rows for ten times, put the result in another computer and it rebuild up the original without knowing the original. In a complex situation we are not able by using our mind to understand the secret links connecting the different things in the datasets. EXAMPLES OF HIDDEN INFORMATION INSIDE THE PICTURE ACM: make visible the invisible Two shapes, we overlap them, and we will see the source image.

I put the first image in the network and after a few cycles the network shows the second image, a sky full of stars. Each white colour in the second map is a real star and they were already present in the first image, but our eyes were not able to see them. Local Contractive Map Equation through which each pixel updates its weight according to the value of the neighbourhood. PRACTICAL APPLICATION This is an arteria In the picture on the right there is a Stenosis The white part presents a tumour. In order to understand the real size of the tumour, we have to put the image into the network. TYPES OF DATA MINING The most common analytics we can apply to data. In blue the classic analytics, the typology of analytics that everybody should know. In red there are the new analytics that some scientists propose to add to the traditional ones. Collect data and use artificial intelligence tools in order to detect hidden information. This kind of data analysis is fundamental.

  • Representational analytics: how to analyse the data to grasp the hidden info linking the data among them, this is not an easy task as also in a small dataset that you can look data are linked in very subtle ways. It will use unsupervised neural network to detect the hidden info embedded in the data itself.
  • Graph analytics: complementary tool to representational analytics. I project a dataset in a graph, nodes and links among nodes, it is not said that the graph is not clearer to me that the data itself es. a graph with 100

them directly). Between input and hidden there is only one link, the input number 1 is linked with the hidden number 1 - > how the input number 1 communicates its strength to the hidden number 1. So, the hidden is a sensor of the network, the hidden number 1 is the way through which it understands the input number 1, it is a perception of the input number 1 - > the hidden layer is how the network perceives the input. The first node of hidden layer - > it is linked to every node of the output. Output layer is how each variable is transformed with the fact of how they interact with all the other variables. Each unit must interact to the others to recompose the global perception. Es. Each node is a person, hidden number 1 is how john perceives himself, the output is John’s personality after that he knew the others and after knowing the others, he changed his personality according to the other people in the group. The equations Equation number 1: X = value of the input, i = number of the variable, p = number of the record - > xip is the first variable of the first record (es. i = 1, p = 1 therefore x is the first value of the dataset). The first input node will be activated by the manipulation of the input node and its weights to the hidden layer. V is the weight connected from x (input) to h (hidden). First face - > neutral; second face - > the eyes are neutral, the mouth is sad; third face - > eyes neutral, mouth happy. The network is showing the differential features of each face. Every element tends to reduce its energy along the time The weights after the training, we will have a big face spontaneously. The task of this network is to synthetize all the knowledge present in the dataset.

FIRST INTERLUDE: The Minimum Spanning Tree MST In which way Auto Contractive map works. Example about Representational analytics, a type of unsupervised analytics. Square metrics - > how each variable is linked to the others, in this metrics there are all the info that the network understood from the dataset. The minimum of energy is represented by the Minimum spanning tree. Square Matrix - > the distance between A and A is 0, the distance between A and C is 5. The opposite of distance is similarity. The more I’m close to one person, the more I’m similar - > the distance between me and myself is 0 and the similarity is the highest. I can transform matrix of similarity in a matrix of distance. Here the highest distance is 5. The similarity between A and B is 1 (5 the highest distance – 4 the distance between A and B = 1 the similarity between A and B). The network shows how variables are similar to the others in the network itself included. I can represent this matrix in a Graph - > the links are the distance you have in the matrix; it is a topological representation of the graphics. I want to have a trip visiting all the nodes, I can have different path. First square: A, D, C, B the distance between A and D is 3. If I make the summation, I have 10, both in the first and the second case. 10 is energy spent to visit all the nodes following these links Second square: different paths. The summation is 11 According to different paths, I have different summation. If you want to minimize the energy, you’ll choose the path number 1. In every case you visit any node, but in the first case you spend less energy. How many different graphs can I build? If I have 4 cities, I can build 16 different graphs.

The network shows me a matrix 27 times 27. The distance between art and art is 0, between art and al is 5,29. The square matrix is provided by Auto cm after learning phase. I want to see how each person is linked to the others. Mike is the person I would arrest as it has more links. The first time we arrest Mike, in a second time AL. When we arrest and remove Mike there is a global rearrangement of the network (second graph). The complexity of the network is increased as the H is bigger. If I arrest AL I have a new graph again and the complexity is much smaller than the first, the third graph is more similar to a chain. When I add some links important to the graph. AL is the boss of a little gang in the maximally regular graph, AL is the real boss of this gang. Ike (policeman) is very close to Mike (jet), in reality Ike was a person in cover agent working in a gang and giving back info to the police. Lez. 16/ PROJECT DATASET IN THE GRAPH USING THE CLASSICAL METHOD (PHYSICAL NETWORK)

  • Hidden power The Map of Power, a web by Beppe Grillo in which showed the Grillo supposed the idea that the boards of directors are the same persons in different companies. That means that there is a hidden power of the same person that try to manipulate the management of different companies. We will try to answer this question by projecting the dataset on a graph. DATAS: 1872 directors + 226 companies *A dataset was made that showed on the columns the companies and on the line the name of the directors. At the center the frequency (frequency of directors that worked at the companies). COMPANY

DIRECTOR FREQUENCY

Every company becomes a node and if two companies share many members of the board, they will be nearer, and their link would be stronger. We can see clearly the connection among more companies. In the center there is a chaotic situation, but sometimes there are some click (organized structure of the company). Some companies are isolated.

This is generated automatically by the software. Nodes are linked even if the directors are not the directors of the same companies. Imagine that you are friend of A, A is friend of C. You have a link to C even if it is not your friend, because it is a friend of A. You can presume that C will be your friend in a delta of time. We call this link resonance. When the click is bigger, the resonance of the link is stronger. For example, in the center, there is a click. The link among the companies is very strong. The distribution of the member of the board there hide a hidden power map. Then, the Grillo hypothesis is right. The red point is the center of the graph. The director board of companies and each of each company is linked to the other. Each member is connected to the other member. Each node of this click (is a click of 8 companies) governs a part of the graph. The number 114 govern the red part of the graph. The number 128 governs the green part of the graph. There are 8 companies in the central click, but just 6 are linked outside. 2 live only in the central click. We have a map of power with an executive of 8 members representing 6 groups of companies. And we have in the executive central click, 2 companies that don’t represent anyone.

The central click: Banca nazionale del lavoro and Carrara spa have no link because they provide money to the group. They don’t need linkages. How can the system learn it? There is a second, third and so on resonance line. The level of attraction of the system is unknown for our brain. From gruppo editoriale l’Espresso there are 4 links. The firsts three links in the south-left link companies governed by Carlo de Benedetti, but If you follow the 4° link that goes to the north you can see that grippe editorial l’espresso is linked to Fastweb. Fastweb go to the north again until Mediaset and other companies of Berlusconi group. There are two separate sub cluster (Berlusconi and Benedetti), but they are from the same group: grippe editoriale espresso. That is strange because Berlusconi and Benedetti are enemies. At the end of 2006, newspaper media communicated that there was a mediation between Berlusconi and Benedetti. While in this map we can see that this mediation would have worked from the beginning from 2006. This map made a prediction: the two companies would have worked together through gruppo editoriale l’espresso to fill their different needs. There is another important news going to the north. The click between Caltagirone editors, Baca finnat euroamerica, Vanini lavori. This seems a Caltagirone group. In 2006 there was a scandal. A member of PD was