"Artificial Intelligence: How Does It Work? And How to Use It?"
By Sabry Fattah
()
About this ebook
In a world increasingly driven by technological advancements, Artificial Intelligence (AI) has emerged as a game-changer, transforming industries and revolutionizing the way we live and work. This book is a must-read guide that takes you on an exhilarating journey into the realm of AI, unraveling its inner workings and empowering you to leverage its potential.
This book is meticulously crafted to provide a holistic understanding of AI, starting with its origins and tracing its evolution through the ages, from its humble beginnings to the cutting-edge technologies of today. Readers wil gain insights into the different types of AI and the fundamental principles that underpin their construction.
You will get a comprehensive understanding of the algorithms that power AI systems. Discover the different model types and their specific applications, enabling you to select the most suitable model for your project.
The book delves deep into the revolutionary ChatGPT, Bing, and Bard models, unraveling their capabilities and showcasing real-world use cases. Learn how to harness the power of thousands of models through Hugging Face, a popular platform for AI development. Understand how to seamlessly connect to Inference points using APIs and explore the parameters that can be adjusted to optimize AI performance.
The book caters to both non-developers and developers alike, providing valuable insights and resources for AI projects. Whether you are a beginner looking to understand the basics or an experienced practitioner seeking advanced techniques, this book offers a wealth of knowledge and practical guidance.
Sabry Fattah
د. صبري عبد الفتاح يعمل استشاري للطب النفسي في انجلترا . تدرب ومارس الطب النفسي بإنجلترا منذ عام1990 وحصل على زمالة الكلية الملكية البريطانية للأطباء النفسيين ودرس بجامعة لندن وأجري ونشرأبحاث بجامعة ادنبره باسكتلندا وهو حاليا مقيم بالمملكة المتحدة.
Read more from Sabry Fattah
Minds Fading Away : Alzheimer's And Dementia Guide Rating: 5 out of 5 stars5/5الاكتئاب : أنواعه وأسبابه وعلاجه Rating: 4 out of 5 stars4/5Understanding Python : Beginner's Guide to Programming Rating: 0 out of 5 stars0 ratingsSchizophrenia Rating: 0 out of 5 stars0 ratingsDepression and Mood Disorders: Causes, Care and Cures Rating: 0 out of 5 stars0 ratingsDepression and Bipolar Disorders : Causes, Care and Cures Rating: 0 out of 5 stars0 ratingsAnxiety Explained: Managing Anxiety and Stress Problems Rating: 0 out of 5 stars0 ratingsAlcohol Problems : From Abuse to Recovery Rating: 0 out of 5 stars0 ratingsThe Hidden Mind Rating: 0 out of 5 stars0 ratings
Related to "Artificial Intelligence
Related ebooks
AI Side Hustle Secrets: Harnessing ChatGPT for Profit Rating: 0 out of 5 stars0 ratingsThe Rise Of Intelligent Machines Rating: 0 out of 5 stars0 ratingsArtificial Intelligence Boon or Bane? Rating: 0 out of 5 stars0 ratingsGuide for Building an AI Robot Rating: 0 out of 5 stars0 ratingsJourney into AI Career Rating: 0 out of 5 stars0 ratingsAI for Everyone: How to Understand and Use Artificial Intelligence Rating: 0 out of 5 stars0 ratingsAI@Work: Humans@WORK Rating: 0 out of 5 stars0 ratingsArtificial Intelligence: ally or enemy? Rating: 0 out of 5 stars0 ratingsThe AI Artificial Intelligence Course From Beginner to Expert Rating: 0 out of 5 stars0 ratingsArtificial Intelligence Class 7: Computer Textbook Series for Artificial Intelligence Rating: 0 out of 5 stars0 ratingsArtificial Intelligence: Securing Enterprise Business: HCM Information Security Rating: 0 out of 5 stars0 ratingsAI, Robots and Humans: Our Servants or Masters? Rating: 0 out of 5 stars0 ratingsMachine Learning and Deep Learning With Python Rating: 0 out of 5 stars0 ratingsArtificial Intelligence Music: Fundamentals and Applications Rating: 0 out of 5 stars0 ratingsTouchpad Plus Ver. 4.0 Class 7 Rating: 0 out of 5 stars0 ratingsTrackpad Pro Ver. 5.0 Class 8 Rating: 0 out of 5 stars0 ratingsThe Ultimate Guide to Chatbot Development:: From Beginner to Pro Rating: 0 out of 5 stars0 ratingsTrackpad Ver. 2.0 Class 8 Rating: 0 out of 5 stars0 ratingsArtificial Intelligence in Program and Project Management Rating: 0 out of 5 stars0 ratingsIncreasing Productivity with Prompt Engineering Rating: 5 out of 5 stars5/5AI Acceleration: A Comprehensive Guide to Adopting Artificial Intelligence in Your Business Rating: 0 out of 5 stars0 ratingsThe Wealth Builder's Journey: How to Build Financial Freedom and Create a Life You Love Rating: 0 out of 5 stars0 ratingsThe Startups Guide to Winning With Artificial Intelligence Rating: 0 out of 5 stars0 ratingsArtificial Intelligence (AI) Unleashed Rating: 0 out of 5 stars0 ratingsChatbots: How To Know Rating: 0 out of 5 stars0 ratingsIntroduction to Artificial Intelligence Rating: 0 out of 5 stars0 ratingsIntermediate AI Prompting – Reinforcement Learning Rating: 0 out of 5 stars0 ratingsSecuring ChatGPT: Best Practices for Protecting Sensitive Data in AI Language Models Rating: 0 out of 5 stars0 ratings
Intelligence (AI) & Semantics For You
101 Midjourney Prompt Secrets Rating: 3 out of 5 stars3/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 5 out of 5 stars5/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5How To Become A Data Scientist With ChatGPT: A Beginner's Guide to ChatGPT-Assisted Programming Rating: 5 out of 5 stars5/5Midjourney Mastery - The Ultimate Handbook of Prompts Rating: 5 out of 5 stars5/5ChatGPT for Marketing: A Practical Guide Rating: 3 out of 5 stars3/5A Quickstart Guide To Becoming A ChatGPT Millionaire: The ChatGPT Book For Beginners (Lazy Money Series®) Rating: 4 out of 5 stars4/5AI for Educators: AI for Educators Rating: 5 out of 5 stars5/5ChatGPT For Fiction Writing: AI for Authors Rating: 5 out of 5 stars5/5ChatGPT For Dummies Rating: 0 out of 5 stars0 ratingsDeep Learning with Python Rating: 5 out of 5 stars5/5TensorFlow in 1 Day: Make your own Neural Network Rating: 4 out of 5 stars4/5Chat-GPT Income Ideas: Pioneering Monetization Concepts Utilizing Conversational AI for Profitable Ventures Rating: 4 out of 5 stars4/5Dancing with Qubits: How quantum computing works and how it can change the world Rating: 5 out of 5 stars5/5Hacking : Guide to Computer Hacking and Penetration Testing Rating: 5 out of 5 stars5/5The Secrets of ChatGPT Prompt Engineering for Non-Developers Rating: 5 out of 5 stars5/5Artificial Intelligence: A Guide for Thinking Humans Rating: 4 out of 5 stars4/5The Algorithm of the Universe (A New Perspective to Cognitive AI) Rating: 5 out of 5 stars5/5ChatGPT Ultimate User Guide - How to Make Money Online Faster and More Precise Using AI Technology Rating: 0 out of 5 stars0 ratingsWhat Makes Us Human: An Artificial Intelligence Answers Life's Biggest Questions Rating: 5 out of 5 stars5/5Dark Aeon: Transhumanism and the War Against Humanity Rating: 5 out of 5 stars5/5
Reviews for "Artificial Intelligence
0 ratings0 reviews
Book preview
"Artificial Intelligence - Sabry Fattah
Artificial Intelligence
How does it work?
and
How to use it?
Dr Sabry Fattah
Copyright@Sabry Fattah 2023
Contents
Artificial Intelligence
Contents
Introduction
Computers and Intelligence:
The Dream of Intelligent Machines:
What is Intelligence Anyway?
What is Artificial Intelligence?
Machine Learning:
How do machines learn?
The History and Evolution of AI
Early Beginnings:
The Birth of AI:
Early AI Approaches:
The AI Winter:
Revival and Modern AI:
Current Applications of AI:
Future Prospects:
Types of Artificial Intelligence
Performance Types:
Capability Types:
Learning Types:
Application Types:
How does Artificial Intelligence Work?
How are AI Models trained:
Vectors:
Controlling the response of AI Model:
Embedding:
Algorithms in AI Training
1. Linear Regression:
2. Logistic Regression:
3. Decision Trees:
4. Support Vector Machines (SVM):
5. Neural Networks:
6. Random Forests:
7. Convolutional Neural Networks (CNN):
8. Recurrent Neural Networks (RNN):
9. Reinforcement Learning:
10. Genetic Algorithms:
11. Bayesian Networks:
12. Transformers:
13.Generative Adversarial Networks (GANs):
14.K-Means Clustering :
15. K- Nearest Neighbours (KNN):
16. Naive Bayes :
17. Gradient descent :
18. Stochastic Gradient Descent (SGD):
Conclusion:
How to build an Artificial Intelligence Project?
How to build an AI system:
TensorFlow:
PyTorch:
Keras:
Scikit-learn:
Hugging Face:
OpenAI Gym:
NVIDIA Deep Learning SDK:
CHATGPT
Prompting in AI
Basic Prompts:
Simple Prompt:
Prompt with generated knowledge
Standard Formats
zero-shot prompting,
few-shot prompting
Elements of a Prompt
General Tips for Designing Prompts
Limitations of Few-shot Prompting
Chain-of-Thought Prompting
Automatic Chain-of-Thought (Auto-CoT)
Self-Consistency
Generated Knowledge Prompting
Tree of Thoughts (ToT)
Retrieval Augmented Generation (RAG)
Adjusting AI models through Parameters
Temperature:
Top-K Sampling:
Top-p (Nucleus) Sampling:
Beam Search (BS) :
Beam width:
Length normalization:
Do_sample:
REPETITION PENALTY:
frequency_penalty:
Maximum length:
Context length:
no_repeat_ngram_size:
num_beams:
early_stopping:
num_return_sequences:
Example of Parameters:
Adjusting these parameters can have the following effects:
Using AI models with API
Working with ChatGPT through an API:
ChatGPT API in Python:
Bing Chatbot API:
Google BARD API:
Hugging Face
How to use Hugging Face Hub
How to use the models on Hugging Face:
Other AI Resources for Developers:
Resources for the Non-Developer User of AI:
Embracing the Future of Artificial Intelligence
Introduction
This book serves as an introduction to Artificial Intelligence for the general reader who is interested in the subject. While expert knowledge of computer programming is not necessary, having a basic understanding of programming will enhance your comprehension of the following chapters. Nonetheless, I aim to present the subject matter in a clear and accessible manner. Without prior programming experience, you will be able to grasp the ethos of artificial intelligence, how it works and how to use the thousands of pre-trained models of AI that are available for free or with minimal subscription
Python is a high-level programming language that is widely used for artificial intelligence (AI), and machine learning. Python's simplicity and readability make it a popular choice for beginners, while its vast library ecosystem and strong community support make it a powerful tool for experienced developers. To have basic understanding of programming in preparation for working with Artificial Intelligence, I recommend you read my book UNDERSTANDING PYTHON: BEGINNERS GUIDE TO PROGRAMMING
which you can find with the current publisher or with Amazon Books.
When it comes to AI, Python offers several libraries and frameworks that make it easier to develop and implement AI algorithms. Some of the most popular libraries for AI are written in Python, which include TensorFlow, Keras, PyTorch, scikit-learn, NLTK (Natural Language Toolkit).
These are just a few examples of the many libraries and frameworks available in Python for AI development. Python's versatility and extensive community support make it an excellent choice for implementing AI algorithms and building intelligent systems.
Computers and Intelligence:
Computers are capable of performing complex calculations and processing large amounts of data much faster than humans. This allows them to solve problems that would be time-consuming or impossible for humans to solve manually. Computers can also store vast amounts of information, including data sets, algorithms, and previous solutions to similar problems. This allows them to access and utilize this stored information to assist in solving new problems.
They can automate repetitive tasks, freeing up human time and resources for more complex problem-solving activities. This can include tasks such as data entry, data analysis. They are also good tools for simulation and modelling.
Computers can simulate real-world scenarios and create models to test and analyse different solutions. This allows for experimentation and optimization without the need for physical prototypes or real-world testing, saving time and resources.
We have access to vast amounts of information through the internet and various databases. This allows for research and gathering of relevant data to inform problem-solving processes. With computer communication and networking, computers have enabled collaboration and communication among individuals and teams working on a problem. This allows for the sharing of ideas, knowledge, and solutions, leading to more efficient and effective problem-solving processes.
It's important to note that while computers can be programmed to perform complex tasks and simulate intelligent behaviour, they do not possess consciousness or subjective experience like humans do.
Computers are not intelligent in any way; they're just very good at doing what we tell them to do. Computers are not capable of thinking in the same way that humans do, as they operate based on logical instructions and algorithms. However, they can be programmed to simulate certain aspects of human cognition, such as problem-solving, pattern recognition, and decision-making.
The Dream of Intelligent Machines:
The dream of intelligent machines has captivated the human imagination for centuries. From ancient myths and legends to modern science fiction, the idea of machines that can think, learn, and reason has both fascinated and terrified us.
In recent years, significant advancements in artificial intelligence (AI) and machine learning have brought us closer to realizing this dream. AI systems can now perform complex tasks such as image recognition, natural language processing, and even beat humans in strategic games like chess and Go.
Intelligent machines have the potential to revolutionize various industries, from healthcare and transportation to finance and manufacturing. They can analyse vast amounts of data, make predictions, and assist in decision-making processes. In healthcare, for example, AI systems can help diagnose diseases, predict patient outcomes, and aid in drug discovery.
However, the dream of intelligent machines also raises ethical concerns. As machines become more advanced, questions about their autonomy, accountability, and potential impact on society arise. There are concerns about job displacement, privacy, and the potential for AI systems to be biased or discriminatory.
To ensure the responsible development and deployment of intelligent machines, it is crucial to have robust ethical frameworks and regulations in place. This includes transparency in AI algorithms, accountability for the decisions made by AI systems, and ongoing monitoring and evaluation of their impact on society.
Ultimately, the dream of intelligent machines holds great promise for humanity. They have the potential to enhance our lives, improve efficiency, and contribute to scientific and technological advancements. However, it is essential to approach this dream with caution, ensuring that the benefits are maximized while minimizing any potential risks.
What is Intelligence Anyway?
The term intelligence
was initially coined in the 1920s to describe the capacity possessed by human beings that enables us to comprehend the world around us.
Intelligence encompasses a wide range of abilities, including the capacity to adapt to one's environment and learn from experience, leading to behavioural modifications. This concept became associated with machines during the Industrial Revolution, as humans started creating problem-solving machines. Thus, the era of artificial intelligence began, focusing on developing machines capable of decision-making and problem-solving. Over time, AI has advanced significantly, giving rise to technologies like machine learning and deep learning, enabling machines to make complex decisions and learn autonomously.
In humans, intelligence manifests through various behaviours, such as reasoning, abstract thinking, language comprehension, learning, and memory retention. Reasoning skills, for instance, involve deductive reasoning, where one derives specific conclusions from general rules. By applying deductive reasoning, the conclusion logically follows from the given premises.
Premise 1: All mammals have hair.
Premise 2: A dog is a mammal.
Conclusion: Therefore, a dog has hair.
Inductive reasoning, on the other hand, involves drawing general conclusions from specific observations. If an individual has observed a pattern - every time they eat peanuts, they experience a headache. Based on this repeated observation, they form a general conclusion that eating peanuts causes them to get a headache. Relying solely on inductive reasoning can lead us astray when making decisions based solely on few observations.
Deductive reasoning is a logical process where you derive specific conclusions from general principles or premises. Inductive reasoning, on the other hand, is a process where you draw general conclusions based on specific observations or evidence.
To avoid errors in deductive reasoning, it is important to ensure that your premises do not contradict each other and that your conclusions logically follow from your premises. To strengthen your deductive reasoning, consider alternative explanations or counterarguments to your conclusions.
Throughout evolution, various animals have demonstrated their ability to use tools. Birds construct intricate nests using twigs and mud, while chimpanzees fashion bows out of sticks. However, until recently, no animal had exhibited signs of advanced language, reasoning, abstract thought, and the ability to learn new behaviours based on thinking rather than instinct, except humans.
Intelligence encompasses not only possessing knowledge but also utilizing it to solve problems. An intelligent person would be able to apply their knowledge to analyse a situation, identify potential solutions, and make informed decisions. They would also be able to adapt and learn from their experiences, continuously improving their problem-solving skills.
Intelligence also involves critical thinking and the ability to think outside the box. An intelligent person can think creatively, coming up with innovative ideas and approaches to solve problems. They can see patterns, make connections between different pieces of information, and generate new insights.
Furthermore, emotional intelligence is an important aspect of intelligence. It involves understanding and managing one's own emotions, as well as recognizing and empathizing with the emotions of others. An emotionally intelligent person can navigate social situations effectively, build strong relationships, and communicate effectively.
Overall, intelligence is a multifaceted trait that combines knowledge, problem-solving skills, critical thinking, creativity, and emotional intelligence. It is not just about what you know, but also how you use that knowledge to navigate and excel in various situations.
What is Artificial Intelligence?
Artificial Intelligence (AI) is a field of computer science that focuses on the development of intelligent machines that can perform tasks that typically require human intelligence. These machines are designed to mimic human cognitive functions, such as learning, problem-solving, perception, and decision-making.
This broad set of technologies that allow machines or computers, which have been programmed with special algorithms, to learn from knowledge and produce output similar to human mental abilities. The goal behind artificially intelligent systems has always remained unchanged: To make them as smart like humans.
These programs were developed and created through programming languages such as: Python; Java etc., using machine learning techniques and trained on huge amount of pre-processed data.
In essence, an algorithm is a systematic programming procedure employed to solve problems. There is nothing particularly extraordinary about it; it is simply another term that