Add Genetic and Multiagent
This commit is contained in:
parent
9b1692afed
commit
0931c79d5a
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Assignment: Diophantine Equations\n",
|
||||
"\n",
|
||||
"> This assignment is part of [AI for Beginners Curriculum](http://github.com/microsoft/ai-for-beginners) and is inspired by [this post](https://habr.com/post/128704/).\n",
|
||||
"\n",
|
||||
"Your goal is to solve so-called **Diophantine equation** - an equation with integer roots and integer coefficients. For example, consider the following equation:\n",
|
||||
"\n",
|
||||
"$$a+2b+3c+4d=30$$\n",
|
||||
"\n",
|
||||
"You need to find integer roots $a$,$b$,$c$,$d\\in\\mathbb{N}$ that satisfy this equation.\n",
|
||||
"\n",
|
||||
"Hints:\n",
|
||||
"1. You can consider roots to be in the interval [0;30]\n",
|
||||
"1. As a gene, consider using the list of root values"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
},
|
||||
"orig_nbformat": 4
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,57 @@
|
|||
# Genetic Algorithms
|
||||
|
||||
**Genetic Algorithms** (GA) are based on **evolutionary approach** to AI, in which methods of evolution of population is used to obtain an optimal solution for a given problem. They were proposed in 1975 by [John Henry Holland](https://en.wikipedia.org/wiki/John_Henry_Holland).
|
||||
|
||||
Genetic Algorithms are based on the following ideas:
|
||||
|
||||
* Valid solutions to the problem can be represented as **genes**
|
||||
* **Crossover** allows us to combine two solutions together to obtain new valid solution
|
||||
* **Selection** is used to select more optimal solutions using some **fitness function**
|
||||
* **Mutations** are introduced to destabilize optimization and get us out of the local minimum
|
||||
|
||||
If you want to implement a Genetic Algorithm, you need the following:
|
||||
|
||||
* To find a method of coding our problem solutions using **genes** g∈Γ
|
||||
* On the set of genes Γ we need to define **fitness function** fit: Γ→**R**. Smaller function values correspond to better solutions.
|
||||
* To define **crossover** mechanism to combine two genes together to get a new valid solution crossover: Γ<sup>2</sub>→Γ.
|
||||
* To define **mutation** mechanism mutate: Γ→Γ.
|
||||
In many cases, crossover and mutation are quite simple algorithms to manipulate genes as numeric sequences or bit vectors.
|
||||
|
||||
Specific implementation of a genetic algorithm can vary from case to case, but overall structure is the following:
|
||||
|
||||
1. Select initial population G⊂Γ
|
||||
2. Randomly select one of the operations that will be performed at this step: crossover or mutation
|
||||
3. **Crossover**:
|
||||
* Randomly select two genes g<sub>1</sub>, g<sub>2</sub> ∈ G
|
||||
* Compute crossover g=crossover(g<sub>1</sub>,g<sub>2</sub>)
|
||||
* If fit(g)<fit(g<sub>1</sub>) or fit(g)<fit(g<sub>2</sub>) - replace corresponding gene in the population by g.
|
||||
4. **Mutation** - select random gene g∈G and replace it by mutate(g)
|
||||
5. Repeat from step 2, until we get sufficiently small value of fit, or until the limit on the number of steps is reached.
|
||||
|
||||
## Typical Tasks
|
||||
|
||||
Tasks typically solved by GA:
|
||||
1. Schedule optimization
|
||||
1. Optimal packing
|
||||
1. Optimal cutting
|
||||
1. Speeding up exhaustive search
|
||||
|
||||
|
||||
## Notebooks
|
||||
|
||||
Go to [Genetic.ipynb](Genetic.ipynb) notebooks to see two examples of using Genetic Algorithms:
|
||||
|
||||
1. Fair division of treasure
|
||||
1. 8 Queen Problem
|
||||
|
||||
## Assignment
|
||||
|
||||
Your goal is to solve so-called **Diophantine equation** - an equation with integer roots. For example, consider the equation a+2b+3c+4d=30. You need to find integer roots that satisfy this equation.
|
||||
|
||||
Hints:
|
||||
1. You can consider roots to be in the interval [0;30]
|
||||
1. As a gene, consider using the list of root values
|
||||
|
||||
Use [Diophantine.ipynb](Diophantine.ipynb) as a starting point.
|
||||
|
||||
*This assignment is inspired by [this post](https://habr.com/post/128704/).*
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Multiagent Systems
|
||||
|
||||
One of the possible ways of achieving intelligence is so-called **emergent** (or **synergetic**) approach, which is based on the fact that combined behavior of many relatively simple agents can result in the overall more complex (or intelligent) behavior of the system as a whole. Theoretically, this is based on the principles of [Collective Intelligence](https://en.wikipedia.org/wiki/Collective_intelligence), [Emergentism](https://en.wikipedia.org/wiki/Global_brain) and [Evolutionary Cybernetics](https://en.wikipedia.org/wiki/Global_brain), which state that higher-level systems gain some sort of added value when being properly combined from lower-level systems (so-called *principle of metasystem transition*).
|
||||
|
||||
The direction of **Multi-Agent Systems** has emerged in AI in 1990s as a response to growth of Internet and distributed systems. On of the classical AI textbooks, [Artificial Intelligence: A Modern Approach](https://en.wikipedia.org/wiki/Artificial_Intelligence:_A_Modern_Approach), focuses on the view of classical AI from the point of view of Multi-agent systems.
|
||||
|
||||
Central to Multi-agent approach is the notion of **Agent** - an entity that lives in some **environment**, which it can perceive, and act upon. This is a very broad definition, and there could be many different types and classifications of agents:
|
||||
|
||||
* By their ability to reason:
|
||||
- **Reactive** agents usually have simple request-response type of behavior
|
||||
- **Deliberative** agents employ some sort of logical reasoning and/or planning capabilities
|
||||
* By the place where agent execute its code:
|
||||
- **Static** agents work on a dedicated network node
|
||||
- **Mobile** agents can move their code between network nodes
|
||||
* By their behavior:
|
||||
- **Passive agents** do not have specific goals. Such agents can react to external stimuli, but will not initiate any actions themselves.
|
||||
- **Active agents** have some goals which they pursue
|
||||
- **Cognitive agents** involve complex planning and reasoning
|
||||
|
||||
Multi-agent systems are nowadays used in a number of applications:
|
||||
* In games, many non-player characters employ some sort of AI, and can be considered to be intelligent agents
|
||||
* In video production, rendering complex 3D scenes that involve crowds is typically done using multi-agent simulation
|
||||
* In systems modeling, multi-agent approach is used to simulate the behavior of a complex model. For example, multi-agent approach has been successfully used to predict the spread of COVID-19 disease worldwide. Similar approach can be used to model traffic in the city, and see how it reacts to changes in traffic rules.
|
||||
* In complex automation systems, each device can act as an independent agent, which makes the whole system less monolith and more robust.
|
||||
|
||||
## NetLogo
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
# Ethical and Responsible AI
|
||||
|
||||
You have almost finished this course, and I hope that by now you clearly see that AI is based on a number of formal mathematical methods that allow us to find relationships in data and train models to replicate the human behavior in some areas. At this point in history, we consider AI to be a very powerful tool to extract patterns from data, and to apply those patterns to solve new problems.
|
||||
|
||||
However, in science fiction we often see stories where AI presents a danger to the humankind. Usually those stories are centered around some sort of AI rebellion, when AI decides to confront human beings. This implies that AI has some sort of emotions, or can take decisions unforeseen by its developers.
|
||||
|
||||
The kind of AI that we have learnt about in this course is nothing more than large matrix arithmetics. It is a very powerful tool to help us solve our problems, and as any other powerful tool - it can be used for good and for bad purposes. What's also important, it can be *misused*.
|
||||
|
||||
## Principles of Responsible AI
|
||||
|
||||
To avoid this accidental misuse of AI, Microsoft states important [Principles of Responsible AI](https://www.microsoft.com/ai/responsible-ai).
|
||||
|
||||
* **Fairness** is related to the important problem of *model biases*, which can be caused by using biased data for training. For example, when we try to predict the probability of getting a software developer job for a person, the model is likely to give higher preference to males - just because the training dataset was likely biased towards male audience. We need to carefully balance training data and investigate the model to avoid biases, and make sure that the model takes into account more relevant features.
|
||||
* **Reliability and Safety**. By their nature, AI models can make mistakes. A neural network returns probabilities, and we need to take it into account when making decisions. Every model has some precision and recall, and we need to understand that to prevent harm that a wrong advice can cause.
|
||||
* **Privacy and Security** have some AI-specific flavour. For example, when we use some data for training a model, this data becomes somehow "integrated" into the model. On one hand, that increases security and privacy, on the other - we need to remember which data the model was trained on.
|
||||
* **Inclusiveness** means that we are not building AI to replace people, but rather to augment people and make our work more creative. It is also related to fairness, because when dealing with underrepresented communities, most of the datasets we collect are likely to be biased, and we need to make sure that those communities are included and correctly handled by AI.
|
||||
* **Transparency**. This includes making sure that we are always clear about AI being used. Also, wherever possible, we want to use AI systems that are *interpretable*.
|
||||
* **Accountability**. When AI models come up with some decisions, it is not always clear who is responsible for those decisions. We need to make sure that we understand the responsibility of AI decisions. In most of the cases we would want to include human being into the loop of taking important decisions, and people are made accountable.
|
||||
|
||||
## Tools for Responsible AI
|
||||
|
||||
At Microsoft, we have developed [Responsible AI Toolbox](https://github.com/microsoft/responsible-ai-toolbox), which contains a set of tools:
|
||||
|
||||
* Interpretability Dashboard (InterpretML)
|
||||
* Fairness Dashboard (FairLearn)
|
||||
* Error Analysis Dashboard
|
||||
* Responsible AI Dashboard that includes
|
||||
- EconML - tool for Causal Analysis, which focuses on what-if questions
|
||||
- DiCE - tool for Counterfactual Analysis allows you to see which features need to be changed to affect the decision of the model
|
||||
|
||||
## Model Interpretability
|
||||
|
||||
* Glass box models
|
||||
* Black box models
|
||||
|
||||
## Model Fairness
|
||||
|
||||
36
README.md
36
README.md
|
|
@ -1,4 +1,4 @@
|
|||
[](https://github.com/microsoft/AI-For-Beginners/blob/master/LICENSE)
|
||||
[](https://github.com/microsoft/AI-For-Beginners/blob/main/LICENSE)
|
||||
[](https://GitHub.com/microsoft/AI-For-Beginners/graphs/contributors/)
|
||||
[](https://GitHub.com/microsoft/AI-For-Beginners/issues/)
|
||||
[](https://GitHub.com/microsoft/AI-For-Beginners/pulls/)
|
||||
|
|
@ -16,18 +16,22 @@
|
|||
Azure Cloud Advocates at Microsoft are pleased to offer a 12-week, 24-lesson curriculum all about **Artificial Intelligence**.
|
||||
|
||||
In this curriculum, you will learn:
|
||||
* Different approaches to Artificial Intelligence, including the "good old" symbolic approach with **Knowledge Representation** and reasoning.
|
||||
* **Neural Networks** and **Deep Learning**, which are at the core of modern AI. We will illustrate the concepts behind these important topics using code in two of the most popular frameworks - TensorFlow(http://Tensorflow.org) and PyTorch(http://pytorch.org).
|
||||
|
||||
* Different approaches to Artificial Intelligence, including the "good old" symbolic approach with **Knowledge Representation** and reasoning ([GOFAI](https://en.wikipedia.org/wiki/Symbolic_artificial_intelligence)).
|
||||
* **Neural Networks** and **Deep Learning**, which are at the core of modern AI. We will illustrate the concepts behind these important topics using code in two of the most popular frameworks - [TensorFlow](http://Tensorflow.org) and [PyTorch](http://pytorch.org).
|
||||
* **Neural Architectures** for working with images and text. We will cover recent models but may lack a little bit on the state-of-the-art.
|
||||
* Less popular AI approaches, such as **Genetic Algorithms**.
|
||||
* Less popular AI approaches, such as **Genetic Algorithms** and **Multi-Agent Systems**.
|
||||
|
||||
What we will not cover in this curriculum:
|
||||
* **Classic Machine Learning**, which is well described in our [Machine Learning for Beginners Curriculum](http://github.com/Microsoft/ML-for-Beginners)
|
||||
* Practical AI applications built using **[Cognitive Services](https://azure.microsoft.com/services/cognitive-services/?WT.mcid=academic-33554-dmitryso)**. For this, we recommend that you start with modules Microsoft Learn for [vision](https://docs.microsoft.com/learn/paths/create-computer-vision-solutions-azure-cognitive-services/?WT.mcid=academic-33554-dmitryso), [natural language processing](https://docs.microsoft.com/learn/paths/explore-natural-language-processing/?WT.mcid=academic-33554-dmitryso) and others.
|
||||
* Specific ML **Cloud Frameworks**, such as [Azure Machine Learning](https://azure.microsoft.com/services/machine-learning/?WT.mcid=academic-33554-dmitryso). There is a great learning path called [Build and operate machine learning solutions with Azure Machine Learning](https://docs.microsoft.com/learn/paths/build-ai-solutions-with-azure-ml-service/?WT.mcid=academic-33554-dmitryso) for this topic.
|
||||
* **Conversational AI** and **Chat Bots**. There is a separate [Create conversational AI solutions](https://docs.microsoft.com/learn/paths/create-conversational-ai-solutions/?WT.mcid=academic-33554-dmitryso) learning path, and you can also refer to [this blog post](https://soshnikov.com/azure/hello-bot-conversational-ai-on-microsoft-platform/) for more detail.
|
||||
|
||||
For a gentle introduction to *AI in the Cloud* topic you may consider taking the [Get started with artificial intelligence on Azure](https://docs.microsoft.com/learn/paths/get-started-with-artificial-intelligence-on-azure/?WT.mcid=academic-33554-dmitryso) Learning Path.
|
||||
* Business cases of using **AI in Business**. Consider taking [Introduction to AI for business users](https://docs.microsoft.com/learn/paths/introduction-ai-for-business-users/?WT.mc_id=academic-33554-dmitryso) learning path on Microsoft Learn, or [AI Business School](https://www.microsoft.com/ai/ai-business-school/?WT.mc_id=academic-33554-dmitryso), developed in cooperation with [INSEAD](https://www.insead.edu/).
|
||||
* **Classic Machine Learning**, which is well described in our [Machine Learning for Beginners Curriculum](http://github.com/Microsoft/ML-for-Beginners)
|
||||
* Practical AI applications built using **[Cognitive Services](https://azure.microsoft.com/services/cognitive-services/?WT.mc_id=academic-33554-dmitryso)**. For this, we recommend that you start with modules Microsoft Learn for [vision](https://docs.microsoft.com/learn/paths/create-computer-vision-solutions-azure-cognitive-services/?WT.mc_id=academic-33554-dmitryso), [natural language processing](https://docs.microsoft.com/learn/paths/explore-natural-language-processing/?WT.mc_id=academic-33554-dmitryso) and others.
|
||||
* Specific ML **Cloud Frameworks**, such as [Azure Machine Learning](https://azure.microsoft.com/services/machine-learning/?WT.mc_id=academic-33554-dmitryso) or [Azure Databricks](). Consider using [Build and operate machine learning solutions with Azure Machine Learning](https://docs.microsoft.com/learn/paths/build-ai-solutions-with-azure-ml-service/?WT.mc_id=academic-33554-dmitryso) and [Build and O perate Machine Learning Solutions with Azure Databricks](https://docs.microsoft.com/learn/paths/build-operate-machine-learning-solutions-azure-databricks/?WT.mc_id=academic-33554-dmitryso) learning paths.
|
||||
* **Conversational AI** and **Chat Bots**. There is a separate [Create conversational AI solutions](https://docs.microsoft.com/learn/paths/create-conversational-ai-solutions/?WT.mc_id=academic-33554-dmitryso) learning path, and you can also refer to [this blog post](https://soshnikov.com/azure/hello-bot-conversational-ai-on-microsoft-platform/) for more detail.
|
||||
* **Deep Mathematics** behind deep learning. For this, we would recommend [Deep Learning](https://www.amazon.com/Deep-Learning-Adaptive-Computation-Machine/dp/0262035618) by Ian Goodfellow, Yoshua Bengio and Aaron Courville, which is also available online at [https://www.deeplearningbook.org/](https://www.deeplearningbook.org/).
|
||||
|
||||
For a gentle introduction to *AI in the Cloud* topic you may consider taking the [Get started with artificial intelligence on Azure](https://docs.microsoft.com/learn/paths/get-started-with-artificial-intelligence-on-azure/?WT.mc_id=academic-33554-dmitryso) Learning Path.
|
||||
|
||||
---
|
||||
# Content
|
||||
|
|
@ -55,8 +59,8 @@ For a gentle introduction to *AI in the Cloud* topic you may consider taking the
|
|||
<td><a href="https://docs.microsoft.com/learn/modules/intro-computer-vision-TensorFlow/?WT.mc_id=academic-33554-dmitryso">MS Learn</a></td>
|
||||
<td>PAT</td></tr>
|
||||
<tr><td>6</td><td>Intro to Computer Vision. OpenCV</td><td>Text<td colspan="2">Notebook</td><td></td></tr>
|
||||
<tr><td>7</td><td>Convolutional Neural Networks<br/>CNN Architectures<br/>Training Tricks</td><td><a href="4-ComputerVision/07-ConvNets/README.md">Text</a><br/><a href="4-ComputerVision/07-ConvNets/CNN_Architectures.md">Text</a></td><td><a href="4-ComputerVision/07-ConvNets/ConvNetsPyTorch.ipynb">PyTorch</a></td><td><a href="4-ComputerVision/07-ConvNets/ConvNetsTF.ipynb">TensorFlow</a></td><td></td></tr>
|
||||
<tr><td>8</td><td>Pre-trained Networks and Transfer Learning</td><td><a href="4-ComputerVision/08-TransferLearning/README.md">Text</a><br/><a href="4-ComputerVision/08-TransferLearning/TrainingTricks.md">Text</a></td><td><a href="4-ComputerVision/08-TransferLearning/TransferLearningPyTorch.ipynb">PyTorch</a></td><td><a href="4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb">TensorFlow</a><br/><a href="4-ComputerVision/08-TransferLearning/Dropout.ipynb">Dropout sample</a></td><td></td></tr>
|
||||
<tr><td>7</td><td>Convolutional Neural Networks<br/>CNN Architectures</td><td><a href="4-ComputerVision/07-ConvNets/README.md">Text</a><br/><a href="4-ComputerVision/07-ConvNets/CNN_Architectures.md">Text</a></td><td><a href="4-ComputerVision/07-ConvNets/ConvNetsPyTorch.ipynb">PyTorch</a></td><td><a href="4-ComputerVision/07-ConvNets/ConvNetsTF.ipynb">TensorFlow</a></td><td></td></tr>
|
||||
<tr><td>8</td><td>Pre-trained Networks and Transfer Learning<br/>Training Tricks</td><td><a href="4-ComputerVision/08-TransferLearning/README.md">Text</a><br/><a href="4-ComputerVision/08-TransferLearning/TrainingTricks.md">Text</a></td><td><a href="4-ComputerVision/08-TransferLearning/TransferLearningPyTorch.ipynb">PyTorch</a></td><td><a href="4-ComputerVision/08-TransferLearning/TransferLearningTF.ipynb">TensorFlow</a><br/><a href="4-ComputerVision/08-TransferLearning/Dropout.ipynb">Dropout sample</a></td><td></td></tr>
|
||||
<tr><td>9</td><td>Autoencoders and VAEs</td><td><a href="4-ComputerVision/09-Autoencoders/README.md">Text</a></td><td>PyTorch</td><td><a href="4-ComputerVision/09-Autoencoders/AutoencodersTF.ipynb">TensorFlow</a></td><td></td></tr>
|
||||
<tr><td>10</td><td>Generative Adversarial Networks</td><td><a href="4-ComputerVision/10-GANs/README.md">Text</a></td><td>PyTorch</td><td><a href="4-ComputerVision/10-GANs/GANs.ipynb">TensorFlow</a></td><td></td></tr>
|
||||
<tr><td>11</td><td>Object Detection</td><td>Text</td><td>PyTorch</td><td>TensorFlow</td><td></td></tr>
|
||||
|
|
@ -74,11 +78,13 @@ For a gentle introduction to *AI in the Cloud* topic you may consider taking the
|
|||
<tr><td>19</td><td>Named Entity Recognition</td><td>Text</td><td>PyTorch</td><td>TensorFlow</td><td></td></tr>
|
||||
<tr><td>20</td><td>Text Generation using GPT</td><td>Text</td><td>PyTorch</td><td>TensorFlow</td><td></td></tr>
|
||||
<tr><td>VI</td><td colspan="4"><b>Other AI Techniques</b></td><td>PAT</td></tr>
|
||||
<tr><td>21</td><td>Genetic Algorithms</td><td>Text<td colspan="2">Notebook</td><td></td></tr>
|
||||
<tr><td>22</td><td>Deep Reinforcement Learning</td><td>Text</td><td>PyTorch</td><td>TensorFlow</td><td></td></tr>
|
||||
<tr><td>23</td><td>Multi-Agent Systems</td><td>Text</td><td></td><td></td><td></td></tr>
|
||||
<tr><td>21</td><td>Genetic Algorithms</td><td><a href="6-Other/21-GeneticAlgorithms/README.md">Text</a><td colspan="2"><a href="6-Other/21-GeneticAlgorithms/Genetic.ipynb">Notebook</a></td><td></td></tr>
|
||||
<tr><td>22</td><td>Deep Reinforcement Learning</td><td><a href="6-Other/22-DeepRL/README.md">Text</a></td><td>PyTorch</td><td>TensorFlow</td><td></td></tr>
|
||||
<tr><td>23</td><td>Multi-Agent Systems</td><td><a href="6-Other/23-MultiagentSystems/README.md">Text</a></td><td></td><td></td><td></td></tr>
|
||||
<tr><td>VII</td><td colspan="4"><b>AI Ethics</b></td><td>PAT</td></tr>
|
||||
<tr><td>24</td><td>AI Ethics and Responsible AI</td><td>Text</td><td></td><td></td><td></td></tr>
|
||||
<tr><td>24</td><td>AI Ethics and Responsible AI</td><td><a href="7-Ethics/README.md">Text</a></td><td></td><td></td><td></td></tr>
|
||||
<tr><td></td><td colspan="4"><b>Extras</b></td><td></td></tr>
|
||||
<tr><td>1</td><td>Multi-Modal Networks, CLIP and VQGAN</td><td><a href="X-Extras/1-MultiModal/README.md">Text</a></td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
|
||||
Each lesson contains some pre-reading material (linked as **Text** above), and some executable Jupyter Notebooks, which are often specific to the framework (**PyTorch** or **TensorFlow**). The executable notebook also contains a lot of theoretical material, so to understand the topic you need to go through at least one version of the notebooks (either PyTorch or TensorFlow). There are also **Labs** available for some topics, which give you an opportunity to try applying the material you have learnt to a specific problem.
|
||||
|
|
|
|||
Loading…
Reference in New Issue