diff --git a/lessons/5-NLP/20-LangModels/README.md b/lessons/5-NLP/20-LangModels/README.md index e5652d5c..36627216 100644 --- a/lessons/5-NLP/20-LangModels/README.md +++ b/lessons/5-NLP/20-LangModels/README.md @@ -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 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)$. +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)$$ > 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) @@ -25,9 +25,12 @@ $$ GPT is not a single model, but rather a collection of models developed and trained by [OpenAI](https://openai.com). -Under the GPT models, we have GPT-2, GPT-3, GPT-3.5 and now, GPT-4. [GPT-2](https://huggingface.co/docs/transformers/model_doc/gpt2#openai-gpt2), has up to 1.5 billion parameters. Next we have the GPT-3 model has up to 175 billion parameters which is 116 times larger than GPT-2. +Under the GPT models, we have: + +| [GPT-2](https://huggingface.co/docs/transformers/model_doc/gpt2#openai-gpt2) | [GPT 3](https://openai.com/research/language-models-are-few-shot-learners) | [GPT-4](https://openai.com/gpt-4) | +| -- | -- | -- | +|Language model with upto 1.5 billion parameters. | Language model with up to 175 billion parameters | 100T parameters and accepts both image and text inputs and outputs text. | -The latest model openly available is [GPT-4](https://openai.com/gpt-4), which is a large multimodal model. GPT-4 accepts both image and text inputs and outputs text. The difference between GPT-3.5 and GPT-4 is subtle, but GPT-4 offere more reliable and creative output as well as is able to handle more nuanced instructions compared to GPT-3.5. [Learn more about GPT-4](https://openai.com/research/gpt-4) The GPT-3 and GPT-4 models are available [as a cognitive service from Microsoft Azure](https://azure.microsoft.com/en-us/services/cognitive-services/openai-service/#overview?WT.mc_id=academic-77998-cacaste), and as [OpenAI API](https://openai.com/api/). diff --git a/lessons/X-Extras/X1-MultiModal/README.md b/lessons/X-Extras/X1-MultiModal/README.md index 553ef8d6..4c44bd1d 100644 --- a/lessons/X-Extras/X1-MultiModal/README.md +++ b/lessons/X-Extras/X1-MultiModal/README.md @@ -1,6 +1,6 @@ # Multi-Modal Networks -After the success of transformer models for solving NLP tasks, there were many attempts to apply the same or similar architectures to computer vision tasks. Also, there is a growing interest in building models that would *combine* vision and natural language capabilities. One of such attempts was done by OpenAI, and it is called CLIP. +After the success of transformer models for solving NLP tasks, the same or similar architectures have been applied to computer vision tasks. There is a growing interest in building models that would *combine* vision and natural language capabilities. One of such attempts was done by OpenAI, and it is called CLIP and DALL.E. ## Contrastive Image Pre-Training (CLIP) @@ -32,7 +32,7 @@ We can also do the opposite. If we have a collection of images, we can pass this Open the [Clip.ipynb](Clip.ipynb) notebook to see CLIP in action. -## Image Generation with VQGAN + CLIP +## Contrastive Image Pre-Training (CLIP) CLIP can also be used for **image generation** from a text prompt. In order to do this, we need a **generator model** that will be able to generate images based on some vector input. One of such models is called [VQGAN](https://compvis.github.io/taming-transformers/) (Vector-Quantized GAN). @@ -56,6 +56,20 @@ Picture generated from prompt *a closeup watercolor portrait of young male teach > Pictures from **Artificial Teachers** collection by [Dmitry Soshnikov](http://soshnikov.com) +## DALL-E +### [DALL-E 1](https://openai.com/research/dall-e) +DALL-E is a version of GPT-3 trained to generate images from prompts. It has been trained with 12-billion parameters. + +Unlike CLIP, DALL-E receives both text and image as a single stream of tokens for both images and text. Therefore, from multiple prompts, you can generate images based on the text. + +### [DALL-E 2](https://openai.com/dall-e-2) +The main difference between DALL.E 1 and 2, is that it generates more realistic images and art. + +Examples of image genrations with DALL-E: +![Picture produced by Pixray](images/DALL·E%202023-06-20%2015.56.56%20-%20a%20closeup%20watercolor%20portrait%20of%20young%20male%20teacher%20of%20literature%20with%20a%20book.png) | ![Picture produced by pixray](images/DALL·E%202023-06-20%2015.57.43%20-%20a%20closeup%20oil%20portrait%20of%20young%20female%20teacher%20of%20computer%20science%20with%20a%20computer.png) | ![Picture produced by Pixray](images/DALL·E%202023-06-20%2015.58.42%20-%20%20a%20closeup%20oil%20portrait%20of%20old%20male%20teacher%20of%20mathematics%20in%20front%20of%20blackboard.png) +----|----|---- +Picture generated from prompt *a closeup watercolor portrait of young male teacher of literature with a book* | Picture generated from prompt *a closeup oil portrait of young female teacher of computer science with a computer* | Picture generated from prompt *a closeup oil portrait of old male teacher of mathematics in front of blackboard* + ## References * VQGAN Paper: [Taming Transformers for High-Resolution Image Synthesis](https://compvis.github.io/taming-transformers/paper/paper.pdf) diff --git a/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.56.56 - a closeup watercolor portrait of young male teacher of literature with a book.png b/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.56.56 - a closeup watercolor portrait of young male teacher of literature with a book.png new file mode 100644 index 00000000..286a9977 Binary files /dev/null and b/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.56.56 - a closeup watercolor portrait of young male teacher of literature with a book.png differ diff --git a/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.57.43 - a closeup oil portrait of young female teacher of computer science with a computer.png b/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.57.43 - a closeup oil portrait of young female teacher of computer science with a computer.png new file mode 100644 index 00000000..30a1d971 Binary files /dev/null and b/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.57.43 - a closeup oil portrait of young female teacher of computer science with a computer.png differ diff --git a/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.58.42 - a closeup oil portrait of old male teacher of mathematics in front of blackboard.png b/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.58.42 - a closeup oil portrait of old male teacher of mathematics in front of blackboard.png new file mode 100644 index 00000000..c4e577fd Binary files /dev/null and b/lessons/X-Extras/X1-MultiModal/images/DALL·E 2023-06-20 15.58.42 - a closeup oil portrait of old male teacher of mathematics in front of blackboard.png differ