Merge branch 'main' of https://github.com/BethanyJep/AI-For-Beginners
This commit is contained in:
commit
e2ad973c7f
|
|
@ -19,4 +19,4 @@ tensorboard==2.8.0
|
|||
tokenizers==0.10.3
|
||||
torchinfo==0.0.8
|
||||
tqdm==4.62.3
|
||||
transformers==4.3.3
|
||||
transformers==4.30.0
|
||||
|
|
|
|||
16
README.md
16
README.md
|
|
@ -16,7 +16,7 @@
|
|||
|:---:|
|
||||
| AI For Beginners - _Sketchnote by [@girlie_mac](https://twitter.com/girlie_mac)_ |
|
||||
|
||||
Azure Cloud Advocates at Microsoft are pleased to offer a 12-week, 24-lesson curriculum all about **Artificial Intelligence**.
|
||||
Explore the world of **Artificial Intelligence** (AI) with Microsoft's 12-week, 24-lesson curriculum! Dive into Symbolic AI, Neural Networks, Computer Vision, Natural Language Processing, and more. Hands-on lessons, quizzes, and labs enhance your learning. Perfect for beginners, this comprehensive guide, designed by experts, covers TensorFlow, PyTorch, and ethical AI principles. Start your AI journey today!"
|
||||
|
||||
In this curriculum, you will learn:
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ In this curriculum, you will learn:
|
|||
What we will not cover in this curriculum:
|
||||
|
||||
* 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-77998-cacaste) learning path on Microsoft Learn, or [AI Business School](https://www.microsoft.com/ai/ai-business-school/?WT.mc_id=academic-77998-cacaste), 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)
|
||||
* **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-77998-cacaste)**. 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-77998-cacaste), [natural language processing](https://docs.microsoft.com/learn/paths/explore-natural-language-processing/?WT.mc_id=academic-77998-cacaste), **[Generative AI with Azure OpenAI Service](https://learn.microsoft.com/en-us/training/paths/develop-ai-solutions-azure-openai/?WT.mc_id=academic-77998-bethanycheum)** and others.
|
||||
* Specific ML **Cloud Frameworks**, such as [Azure Machine Learning](https://azure.microsoft.com/services/machine-learning/?WT.mc_id=academic-77998-cacaste), [Microsoft Fabric](https://learn.microsoft.com/en-us/training/paths/get-started-fabric/?WT.mc_id=academic-77998-bethanycheum), or [Azure Databricks](https://docs.microsoft.com/learn/paths/data-engineer-azure-databricks?WT.mc_id=academic-77998-cacaste). 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-77998-cacaste) and [Build and Operate Machine Learning Solutions with Azure Databricks](https://docs.microsoft.com/learn/paths/build-operate-machine-learning-solutions-azure-databricks/?WT.mc_id=academic-77998-cacaste) 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-77998-cacaste) 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.
|
||||
|
|
@ -118,12 +118,12 @@ Get started with the following resources:
|
|||
|
||||
However, if you would like to take the course as a self-study project, we suggest that you fork the entire repo to your own GitHub account and complete the exercises on your own or with a group:
|
||||
|
||||
- Start with a pre-lecture quiz
|
||||
- Read the intro text for the lecture
|
||||
- If the lecture has additional notebooks, go through them, reading and executing the code. If both TensorFlow and PyTorch notebooks are provided, you can focus on one of them - choose your favorite framework
|
||||
- Notebooks often contain some of the challenges that require you to tweak the code a little bit to experiment
|
||||
- Take the post-lecture quiz
|
||||
- If there is a lab attached to the module - complete the assignment
|
||||
- Start with a pre-lecture quiz.
|
||||
- Read the intro text for the lecture.
|
||||
- If the lecture has additional notebooks, go through them, reading and executing the code. If both TensorFlow and PyTorch notebooks are provided, you can focus on one of them - choose your favorite framework.
|
||||
- Notebooks often contain some of the challenges that require you to tweak the code a little bit to experiment.
|
||||
- Take the post-lecture quiz.
|
||||
- If there is a lab attached to the module - complete the assignment.
|
||||
- Visit the [Discussion board](https://github.com/microsoft/AI-For-Beginners/discussions) to "learn out loud".
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ tensorboard==2.8.0
|
|||
tokenizers==0.10.3
|
||||
torchinfo==0.0.8
|
||||
tqdm==4.62.3
|
||||
transformers==4.3.3
|
||||
transformers==4.30.0
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -14,9 +14,9 @@
|
|||
"vue-router": "^3.4.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/cli-plugin-babel": "~5.0.8",
|
||||
"@vue/cli-plugin-eslint": "~5.0.8",
|
||||
"@vue/cli-service": "~5.0.8",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ Untyped-Language | doesn't have | type definitions
|
|||
- **Scenarios** are special kind of frames that represent complex situations that can unfold in time.
|
||||
|
||||
**Python**
|
||||
|
||||
Slot | Value | Default value | Interval |
|
||||
-----|-------|---------------|----------|
|
||||
Name | Python | | |
|
||||
|
|
@ -149,7 +150,7 @@ Expert systems can be implemented using different tools:
|
|||
|
||||
## ✍️ Exercise: Animal Inference
|
||||
|
||||
See [Animals.ipynb](Animals.ipynb) for an example of implementing forward and backward inference expert system.
|
||||
See [Animals.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/2-Symbolic/Animals.ipynb) for an example of implementing forward and backward inference expert system.
|
||||
|
||||
> **Note**: This example is rather simple, and only gives the idea of how an expert system looks like. Once you start creating such a system, you will only notice some *intelligent* behaviour from it once you reach certain number of rules, around 200+. At some point, rules become too complex to keep all of them in mind, and at this point you may start wondering why a system makes certain decisions. However, the important characteristics of knowledge-based systems is that you can always *explain* exactly how any of the decisions were made.
|
||||
|
||||
|
|
@ -206,7 +207,8 @@ GROUP BY ?eyeColorLabel
|
|||
|
||||
## ✍️ Exercise: A Family Ontology
|
||||
|
||||
See [FamilyOntology.ipynb](FamilyOntology.ipynb) for an example of using Semantic Web techniques to reason about family relationships. We will take a family tree represented in common GEDCOM format and an ontology of family relationships and build a graph of all family relationships for given set of individuals.
|
||||
|
||||
See [FamilyOntology.ipynb](https://github.com/Ezana135/AI-For-Beginners/blob/main/lessons/2-Symbolic/FamilyOntology.ipynb) for an example of using Semantic Web techniques to reason about family relationships. We will take a family tree represented in common GEDCOM format and an ontology of family relationships and build a graph of all family relationships for given set of individuals.
|
||||
|
||||
## Microsoft Concept Graph
|
||||
|
||||
|
|
@ -220,7 +222,7 @@ The Graph is available either as REST API, or as a large downloadable text file
|
|||
|
||||
## ✍️ Exercise: A Concept Graph
|
||||
|
||||
Try the [MSConceptGraph.ipynb](MSConceptGraph.ipynb) notebook to see how we can use Microsoft Concept Graph to group news articles into several categories.
|
||||
Try the [MSConceptGraph.ipynb](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/2-Symbolic/MSConceptGraph.ipynb) notebook to see how we can use Microsoft Concept Graph to group news articles into several categories.
|
||||
|
||||
## Conclusion
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@
|
|||
" \\end{cases} \\\\\n",
|
||||
"$$\n",
|
||||
"\n",
|
||||
"However, a generic linear model should also have a bias, i.e. ideally we should compute $y$ as $y=f(\\mathbf{w}^{\\mathrm{T}}\\mathbf{x})+\\mathbf{b}$. To simplify our model, we can get rid of this bias term by adding one more dimension to our input features, which always equals to 1:"
|
||||
"However, a generic linear model should also have a bias, i.e. ideally we should compute $y$ as $y=f(\\mathbf{w}^{\\mathrm{T}}\\mathbf{x}+\\mathbf{b})$. To simplify our model, we can get rid of this bias term by adding one more dimension to our input features, which always equals to 1:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -213,9 +213,9 @@
|
|||
" * $t_{n} \\in \\{-1, +1\\}$ for negative and positive training samples, respectively\n",
|
||||
" * $\\mathcal{M}$ - a set of wrongly classified examples\n",
|
||||
" \n",
|
||||
"We will use the process of **graident descent**. Starting with some initial random weights $\\mathbf{w}^{(0)}$, we will adjust weights on each step of the training using the gradient of $E$:\n",
|
||||
"We will use the process of **gradient descent**. Starting with some initial random weights $\\mathbf{w}^{(0)}$, we will adjust weights on each step of the training using the gradient of $E$:\n",
|
||||
"\n",
|
||||
"$$\\mathbf{w}^{\\tau + 1}=\\mathbf{w}^{\\tau} - \\eta \\nabla E(\\mathbf{w}) = \\mathbf{w}^{\\tau} + \\eta \\mathbf{x}_{n} t_{n}$$\n",
|
||||
"$$\\mathbf{w}^{\\tau + 1}=\\mathbf{w}^{\\tau} - \\eta \\nabla E(\\mathbf{w}) = \\mathbf{w}^{\\tau} + \\eta\\sum_{n \\in \\mathcal{M}}\\mathbf{x}_{n} t_{n}$$\n",
|
||||
"\n",
|
||||
"where $\\eta$ is a **learning rate**, and $\\tau\\in\\mathbb{N}$ - number of iteration.\n",
|
||||
"\n",
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"!rm *.pkl\n",
|
||||
"!wget https://raw.githubusercontent.com/microsoft/AI-For-Beginners/main/data/mnist.pkl.gz\n",
|
||||
"https://github.com/mnielsen/neural-networks-and-deep-learning/blob/master/data/mnist.pkl.gz",
|
||||
"!gzip -d mnist.pkl.gz"
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "En2vX4FuwHlu"
|
||||
|
|
@ -16,6 +17,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "8cACQoFMwHl3"
|
||||
|
|
@ -65,6 +67,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "6tp2xGV7wHl4"
|
||||
|
|
@ -83,6 +86,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "A10prCPowHl7"
|
||||
|
|
@ -185,6 +189,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -206,6 +211,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "SjPlpf2-wHl8"
|
||||
|
|
@ -251,6 +257,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -292,6 +299,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -313,6 +321,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -320,7 +329,7 @@
|
|||
"* `x` and `y` specify training data, features and labels respectively\n",
|
||||
"* If we want validation to be performed on each epoch, we can specify `validation_data` parameter, which would be a tuple of features and labels\n",
|
||||
"* `epochs` specified the number of epochs\n",
|
||||
"* If we want training to happen in minibatches, we can speficu `batch_size` parameter. You can also pre-batch the data manually before passing it to `x`/`y`/`validation_data`, in which case you do not need `batch_size`"
|
||||
"* If we want training to happen in minibatches, we can specify `batch_size` parameter. You can also pre-batch the data manually before passing it to `x`/`y`/`validation_data`, in which case you do not need `batch_size`"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -370,6 +379,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "s4_Atvn5K4K9"
|
||||
|
|
@ -423,6 +433,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "dvAiaj_JndyP"
|
||||
|
|
@ -508,6 +519,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -578,6 +590,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -634,6 +647,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
|
|
@ -647,6 +661,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "BmHNhUU8bqEX"
|
||||
|
|
@ -669,6 +684,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "gZ-kWx84bMDH"
|
||||
|
|
@ -683,6 +699,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "yX6hqiafwHl9"
|
||||
|
|
|
|||
|
|
@ -292,6 +292,16 @@
|
|||
"> **Note:** When you first create word vectors, downloading them can take some time!"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import gensim.downloader as api\n",
|
||||
"w2v = api.load('word2vec-google-news-300')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
|
|
@ -409,7 +419,7 @@
|
|||
"d = np.sum((w2v.vectors-qvec)**2,axis=1)\n",
|
||||
"min_idx = np.argmin(d)\n",
|
||||
"# find the corresponding word\n",
|
||||
"w2v.index2word[min_idx]"
|
||||
"w2v.index_to_key[min_idx]"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -432,7 +442,7 @@
|
|||
"\n",
|
||||
"**FastText** tries to overcome the second limitation, and builds on Word2Vec by learning vector representations for each word and the charachter n-grams found within each word. The values of the representations are then averaged into one vector at each training step. While this adds a lot of additional computation to pretraining, it enables word embeddings to encode sub-word information.\n",
|
||||
"\n",
|
||||
"Another method, **GloVe**, uses a different approach to word embeddings, based on the factorization of the word-context matrix. First, it builds a large matrix that counts the number of word occurences in different contexts, and then it tries to represent this matrix in lower dimensions in a way that minimizes reconstruction loss.\n",
|
||||
"Another method, **GloVe**, uses a different approach to word embeddings, based on the factorization of the word-context matrix. First, it builds a large matrix that counts the number of word occurrences in different contexts, and then it tries to represent this matrix in lower dimensions in a way that minimizes reconstruction loss.\n",
|
||||
"\n",
|
||||
"The gensim library supports those word embeddings, and you can experiment with them by changing the model loading code above."
|
||||
]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ The idea of a neural network being able to do general tasks without downstream t
|
|||
|
||||
> Understanding and being able to produce text also entails knowing something about the world around us. People also learn by reading to the large extent, and GPT network is similar in this respect.
|
||||
|
||||
Text generation networks wor;k by predicting probability of the next word $$P(w_N)$$ However, unconditional probability of the next word equals to the frequency of the this word in the text corpus. GPT is able to give us **conditional probability** of the next word, given the previous ones: $$P(w_N | w_{n-1}, ..., w_0)$$
|
||||
Text generation networks work by predicting probability of the next word $$P(w_N)$$ However, unconditional probability of the next word equals to the frequency of the this word in the text corpus. GPT is able to give us **conditional probability** of the next word, given the previous ones: $$P(w_N | w_{n-1}, ..., w_0)$$
|
||||
|
||||
> You can read more about probabilities in our [Data Science for Beginers Curriculum](https://github.com/microsoft/Data-Science-For-Beginners/tree/main/1-Introduction/04-stats-and-probability)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ torchaudio==0.8.1
|
|||
torchinfo==0.0.8
|
||||
torchtext==0.9.1
|
||||
torchvision==0.9.1
|
||||
transformers==4.3.3
|
||||
transformers==4.30.0
|
||||
|
|
@ -10,4 +10,4 @@ scipy
|
|||
TensorFlow
|
||||
TensorFlow_datasets
|
||||
TensorFlow_text
|
||||
transformers==4.3.3
|
||||
transformers==4.30.0
|
||||
Loading…
Reference in New Issue