AI Essentials: An In-Depth Study Guide for Developers

Edward Tsang
25 min readJul 23, 2022
Image via www.vpnsrus.com

Sharing notes from our AI and Machine Learning study sessions with new developers. We run these induction sessions when we have new coder joining our team, covering key tech topics all coders should know like AI, Blockchain, Cloud and Big Data, as well as other hot topics like Crypto, Metaverse, NFT, etc. They spent a week researching into the topic with some starting questions, then meet up to discuss the topic for an hour or so, followed by a week or so to write up the topic in their own words. We will update and edit these notes every now and then, and we welcome feedback and comments. Thanks. (Still Editing)

About Us: OnDemandWorld team, we are working on a new blockchain and AI app solutions. Niftnack NFT and TechHub Jobs. MVP already on App Store and Google Play. We are building the first scalable version now. Looking for new junior devs, blockchain devs, full-stack devs, etc. Contact us for more information. Remote working mostly in 2022 unless you are in Shanghai already.

(First week, aim at around 13 hours or so in total, to research into the topic. Try to answer the following questions. Jot down notes for the meeting. 5–10 Pages.)

Tech Topic 4: AI and Machine Learning

  • What is machine learning? What can it learn? How does it work in the big data era?
  • What are the common machine learning algorithms? And what are the tools we usually use?
  • What is Bayes Optimal Error?
  • What about Artificial Intelligence? Can it outsmart human?
  • Major challenges? Biases? Limits?
  • Samples of most successful projects?

Digging deeper:

  • What are the key differences of supervised, unsupervised, and reinforcement learning?
  • What are the popular Neural Networks? What are they used for?
  • What are the popular GANs? What are they used for?
  • What are the common tools? Take a look at Tensorflow, PyTorch, OpenCV, Keras, Caffe2, SageMaker and Google Cloud AI.
  • How to become an AI programmer?

(And here are our notes and summary to the questions above, covered in about an hour or so of discussion. Still editing these. Feel free to leave us with comments and suggestions, thanks.)

AI & Machine Learning has caught the attention of many in recent years. Recently with the ChatGPT, Bing Chat and Github Co-pilot wave of marketing buzz. From Siri and robot vacuum cleaners coming into our daily life to AlphaGo beating the top professional players, we have acknowledged the potential of AI but have also started to wonder what are the limits of AI and whether these cold machines will someday outsmart us, replace us, or go against us. The somewhat controversial relationship between humans and machines is also a hot topic that has opened up imaginations for art creation. We can see this in films. The movie A.I. tells stories of a robot boy capable of experiencing love but was not trusted by his “mother”, and the movie The Terminator illustrates the possibility of AI becoming an existential threat, turning evil and killing everyone.

Nonetheless, AI & Machine Learning is a trend that is unavoidable. And to understand everything, we first need a solid understanding of what is A.I. and Machine Learning.

What is machine learning? What can it learn? How does it work in the big data era?

Machine learning is a type of artificial intelligence that enables computer systems to automatically learn and improve from experience without being explicitly programmed. In other words, machine learning involves developing algorithms and models that can analyze and learn patterns from data, and then use that knowledge to make predictions or decisions.

Machine learning can learn a wide range of tasks, including but not limited to:

  1. Classification: Predicting which category a new observation belongs to, based on its features. For example, classifying an email as spam or not spam.
  2. Regression: Predicting a continuous value for a new observation, based on its features. For example, predicting the price of a house based on its location, size, and other characteristics.
  3. Clustering: Grouping similar observations together, based on their features. For example, clustering customers based on their purchasing behavior.
  4. Association rule learning: Finding patterns and relationships between variables in large datasets. For example, identifying which products are often bought together in a supermarket.

Machine learning works in the big data era by leveraging the vast amounts of data available to train models and improve their accuracy. With more data, machine learning algorithms can learn more complex patterns and make more accurate predictions or decisions. However, handling and processing such large amounts of data can also present challenges, such as computational power, storage, and data quality. Therefore, machine learning in the big data era requires sophisticated algorithms and tools, such as distributed computing, cloud computing, and deep learning techniques.

What are the common machine learning algorithms? And what are the tools we usually use?

There are many machine learning algorithms, and the choice of which algorithm to use depends on the problem you are trying to solve, the data you have available, and the goals you want to achieve. Here are some common machine learning algorithms:

  1. Linear regression: A supervised learning algorithm used for regression tasks that aims to find the best-fit line that describes the relationship between the input variables and the output variable.
  2. Logistic regression: A supervised learning algorithm used for classification tasks that aims to find the best-fit line that separates the different classes in the data.
  3. Decision trees: A supervised learning algorithm that builds a tree-like model of decisions and their possible consequences, used for both classification and regression tasks.
  4. Random forests: An ensemble learning algorithm that combines multiple decision trees to improve the accuracy and robustness of the model.
  5. Support vector machines (SVMs): A supervised learning algorithm used for both classification and regression tasks that aims to find the best hyperplane that separates the different classes in the data.
  6. K-nearest neighbors (KNN): A supervised learning algorithm used for classification tasks that predicts the class of a new data point by finding the K nearest data points in the training set.
  7. Naive Bayes: A supervised learning algorithm used for classification tasks that applies Bayes’ theorem with the assumption of independence between features.
  8. Neural networks: A family of algorithms inspired by the structure and function of the brain, used for both classification and regression tasks. Deep learning, which involves neural networks with many layers, has become popular for processing large amounts of data and achieving state-of-the-art results in various domains.

There are many tools available for implementing and deploying machine learning models, including:

  1. Python-based libraries such as Scikit-learn, Tensorflow, PyTorch, and Keras
  2. R-based libraries such as caret, mlr, and randomForest
  3. Cloud-based platforms such as Google Cloud AI Platform, Amazon SageMaker, and Microsoft Azure Machine Learning
  4. Big data frameworks such as Apache Spark, Hadoop, and Flink
  5. AutoML tools that automate the machine learning pipeline, such as Google AutoML, H2O.ai, and DataRobot.

What is Bayes Optimal Error?

Bayes optimal error, also known as Bayes error or irreducible error, is the lowest possible error rate that can be achieved by any classifier or model on a given classification problem. It represents the intrinsic difficulty of the problem itself and is independent of the specific learning algorithm or model used.

Bayes error is the theoretical lowest error possible on a task. Not just about the AI or Machine Learning model, it includes human as a classifier or model. It’s a common misunderstanding to assume that human works at or very near to Bayes optimal, but that is not true. Even more challenging is when we are unable to tell if a machine have exceeded our own intellect. The “unknown unknowns” problem.

The gap between human error and such theoretical Bayes optimal error is small on trivial tasks only. Most skilled tasks will have wider gap. Like playing chess or even manual algebraic calculations. It’s important to understand this as we have the tendency to aim at perfection rather than looking at practical cases. We care disproportionately about AI beating the best chess or Go players, without understand that an average app on your phone can probably beat 99% of all chess players anyway.

Image linked from https://www.thinkingondata.com/notes-about-structuring-machine-learning-projects-by-andrew-ng-part-ii/

Bayes optimal error is calculated based on Bayes’ theorem, which provides a way to compute the probability of a hypothesis or label given the evidence or input features. Bayes optimal error is the error rate of the optimal Bayesian classifier, which assigns labels to inputs based on the posterior probabilities of the different classes.

In other words, Bayes optimal error is the error rate that would be achieved by a hypothetical “perfect” classifier that knows the true distribution of the input features and their associated labels. It is the theoretical lower bound on the error rate of any classifier.

Bayes optimal error is important in evaluating the performance of machine learning models. If a model’s error rate is close to the Bayes optimal error, it means that the model is performing well and capturing most of the available information in the data. On the other hand, if a model’s error rate is far above the Bayes optimal error, it suggests that there is still room for improvement in the model or in the quality of the data.

https://datascience.stackexchange.com/questions/37268/estimation-of-bayes-error-human-level-error

https://github.com/mbadry1/DeepLearning.ai-Summary/blob/master/3-%20Structuring%20Machine%20Learning%20Projects/Readme.md

What about Artificial Intelligence? Can it outsmart human?

Artificial intelligence (AI) refers to computer systems that can perform tasks that typically require human intelligence, such as recognizing speech, understanding natural language, making decisions, and learning from experience. AI has made significant advances in recent years and has demonstrated impressive capabilities in various domains, including image and speech recognition, playing games, and natural language processing.

However, whether AI can outsmart human depends on the specific task and context. In some cases, AI has already surpassed human performance, such as in playing complex games like chess and Go, where AI algorithms like AlphaZero and AlphaGo have defeated human champions. In other cases, AI still struggles to match human performance, such as in understanding and producing natural language, which remains a challenging problem in AI research.

It’s important to note that AI and humans have different strengths and weaknesses. AI systems excel at processing large amounts of data, recognizing patterns, and performing repetitive tasks with high accuracy and consistency. However, they can also be limited by their narrow scope of knowledge, lack of common sense reasoning, and inability to interpret complex social and emotional cues.

On the other hand, humans have a broad range of knowledge, creativity, and common sense reasoning that allows them to adapt to new situations, solve complex problems, and interact with others in a meaningful way. Humans also have the ability to learn from experience and make decisions based on ethical, moral, and social considerations, which are difficult for AI to replicate.

Therefore, while AI can outperform humans in certain tasks, it is unlikely to outsmart humans in the broader sense of intelligence and cognitive abilities. AI is still a tool that requires human guidance and oversight to ensure that it is used ethically, responsibly, and for the benefit of society.

Major challenges? Biases? Limits?

There are several major challenges, biases, and limits associated with artificial intelligence and machine learning:

  1. Data biases: AI and machine learning systems are only as good as the data they are trained on. If the training data is biased or unrepresentative, the AI system can inherit and amplify those biases, leading to unfair or discriminatory outcomes.
  2. Interpretability: Many AI and machine learning algorithms are complex and difficult to interpret, which can make it challenging to understand how they make decisions or identify the causes of errors.
  3. Overfitting: Machine learning models can be prone to overfitting, where they perform well on the training data but fail to generalize to new data. This can happen when the model is too complex or when there is too little data available.
  4. Adversarial attacks: AI and machine learning models can be vulnerable to adversarial attacks, where an attacker manipulates the input data to mislead or fool the system. This can be a concern in security-critical applications such as autonomous vehicles and facial recognition systems.
  5. Resource constraints: Many AI and machine learning algorithms require significant computational resources, which can limit their applicability in resource-constrained environments such as mobile devices or edge computing systems.
  6. Ethical and social implications: AI and machine learning systems can have significant ethical and social implications, such as job displacement, privacy violations, and algorithmic bias. It is important to ensure that these systems are developed and used in a responsible and ethical manner.

To address these challenges and biases, researchers and practitioners in the field of AI are working on developing new algorithms, tools, and methodologies to improve the reliability, transparency, and interpretability of AI systems. There is also growing recognition of the need for diversity, inclusivity, and ethical considerations in AI research and development.

Samples of most successful projects?

There are many successful AI and machine learning projects that have had a significant impact in various domains, some of which include:

  1. Image recognition: The ImageNet project, which used deep learning algorithms to classify images into 1,000 categories, has led to significant advances in image recognition and computer vision. This technology is now used in various applications, including self-driving cars, medical imaging, and facial recognition systems.
  2. Language processing: Google’s BERT (Bidirectional Encoder Representations from Transformers) algorithm, which uses a neural network to analyze language and understand its meaning, has improved the accuracy of natural language processing tasks such as question answering and sentiment analysis.
  3. Healthcare: The IBM Watson Health project has used AI and machine learning algorithms to analyze medical data and assist in diagnosis and treatment decisions. This technology has the potential to improve patient outcomes and reduce healthcare costs.
  4. Robotics: Boston Dynamics’ robots, such as Spot and Atlas, use AI and machine learning algorithms to perform tasks such as navigating complex environments, manipulating objects, and even dancing. These robots have the potential to revolutionize industries such as manufacturing, logistics, and search and rescue operations.
  5. Gaming: DeepMind’s AlphaGo and AlphaZero algorithms have demonstrated remarkable success in playing complex games such as chess, Go, and shogi. These algorithms use deep reinforcement learning to improve their performance through trial and error, and have defeated some of the world’s top human players.

As the field continues to advance, we can expect to see more innovative and transformative applications of AI and machine learning in the future.

What are the key differences of supervised, unsupervised, and reinforcement learning?

Supervised learning, unsupervised learning, and reinforcement learning are three main categories of machine learning algorithms. The key differences between them are:

  1. Supervised Learning: In supervised learning, the algorithm is trained on labeled data, where each example in the training data has a corresponding label or output that the algorithm is trying to predict. The goal is to learn a function that maps input features to output labels accurately. The algorithm uses this labeled data to learn from the examples and make predictions on new, unseen data.

Example: A supervised learning algorithm can be trained to predict the price of a house based on its features such as location, number of rooms, and square footage. The algorithm is trained on a dataset of houses with their corresponding prices.

  1. Unsupervised Learning: In unsupervised learning, the algorithm is trained on unlabeled data, where the algorithm tries to find patterns or structure in the data without any guidance or labels. The goal is to discover underlying relationships and groupings in the data.

Example: An unsupervised learning algorithm can be used to cluster customers based on their purchasing behavior. The algorithm is trained on a dataset of customer purchases without any labels or specific information on what types of customers belong to what groups.

  1. Reinforcement Learning: In reinforcement learning, the algorithm learns through trial and error by interacting with an environment. The algorithm receives feedback in the form of rewards or penalties for its actions, and its goal is to learn a policy that maximizes the cumulative reward over time.

Example: A reinforcement learning algorithm can be trained to play a game, such as chess or Go. The algorithm receives feedback in the form of points for winning or losing, and it learns from its mistakes and successes to improve its strategy over time.

In summary, supervised learning involves learning from labeled data, unsupervised learning involves finding patterns in unlabeled data, and reinforcement learning involves learning through trial and error by interacting with an environment. Each type of learning has its own strengths and weaknesses, and the choice of which type of learning to use depends on the specific problem and data available.

What are the popular Neural Networks? What are they used for?

Neural networks are a type of machine learning algorithm inspired by the structure and function of the human brain. They consist of interconnected nodes (neurons) organized into layers, with each layer processing and transforming input data to produce an output. There are several popular neural network architectures, including:

  1. Feedforward Neural Networks: This is the most basic type of neural network, where the information flows in one direction from the input layer through one or more hidden layers to the output layer. They are used for various applications such as image classification, speech recognition, and natural language processing.
  2. Convolutional Neural Networks (CNNs): CNNs are commonly used in computer vision applications to classify and identify images. They are designed to detect features such as edges and shapes in an image and are particularly effective at identifying spatial relationships between pixels.
  3. Recurrent Neural Networks (RNNs): RNNs are used for sequential data such as speech recognition, language modeling, and time-series forecasting. They have the ability to remember previous inputs and use them to influence future outputs, making them well suited to modeling sequences of data.
  4. Long Short-Term Memory (LSTM) Networks: LSTMs are a type of RNN designed to address the problem of vanishing gradients in long sequences. They are used for speech recognition, language modeling, and other applications where long-term dependencies are important.
  5. Generative Adversarial Networks (GANs): GANs are used for generating new data that resembles the original training data. They consist of two neural networks, a generator that generates new data and a discriminator that distinguishes the generated data from the real data.

Neural networks are used in various applications such as computer vision, natural language processing, speech recognition, and robotics. They are particularly effective at tasks that involve pattern recognition, prediction, and classification.

What are the popular GANs? What are they used for?

Generative Adversarial Networks (GANs) are a type of neural network that consists of two networks — a generator and a discriminator — that work together to generate new data that resembles the original training data. The generator creates new data samples, while the discriminator evaluates how well the generated samples match the real ones. The goal of the generator is to create samples that are indistinguishable from the real data, while the discriminator’s goal is to correctly identify the real samples from the generated ones.

Here are some popular types of GANs and their applications:

  1. Deep Convolutional GANs (DCGANs): DCGANs are a type of GAN that use convolutional neural networks to generate new images. They are widely used in computer vision applications such as image generation, style transfer, and image-to-image translation.
  2. CycleGANs: CycleGANs are used for image-to-image translation, such as converting a picture of a horse into a picture of a zebra. They use a cyclic consistency loss to ensure that the generated images are consistent with each other.
  3. Conditional GANs: Conditional GANs are used for generating data with specific attributes, such as generating images of cars with different colors or styles. They are trained on both the input data and the desired attributes, which are used to condition the generator.
  4. Wasserstein GANs (WGANs): WGANs are a type of GAN that use a different loss function to improve the stability and quality of the generated samples. They are commonly used in image and video generation.
  5. StyleGANs: StyleGANs are a type of GAN that generate high-quality images with fine-grained control over the image’s style and attributes. They are used in applications such as photorealistic image synthesis, art generation, and video generation.

Overall, GANs have a wide range of applications, including image and video generation, text-to-image synthesis, data augmentation, and anomaly detection. They are a powerful tool for generating new data samples that can be used for training other machine learning models or for creating new content in various fields.

What are the common tools? How to start playing with AI?

There are several popular tools and frameworks for working with artificial intelligence (AI) and machine learning (ML). Here are some of the most common ones:

  1. Python: Python is a popular programming language for data science and machine learning. It has several libraries and frameworks such as TensorFlow, PyTorch, Scikit-learn, and Keras, which are commonly used for building ML models.
  2. TensorFlow: TensorFlow is an open-source platform for building and deploying ML models. It provides a wide range of tools and libraries for creating neural networks, including Keras, which is a high-level API for building ML models.
  3. PyTorch: PyTorch is a popular open-source machine learning library that is widely used in research and production. It is known for its dynamic computational graph and easy-to-use API.
  4. Scikit-learn: Scikit-learn is a popular Python library for machine learning. It provides tools for data preprocessing, feature extraction, model selection, and evaluation.
  5. Jupyter Notebooks: Jupyter Notebooks is an interactive web-based environment for working with data and ML models. It allows you to write and run code, visualize data, and share your results with others.

If you’re just getting started with AI and ML, here are some steps you can take:

  1. Learn the basics of programming: Familiarize yourself with a programming language such as Python or R, which are commonly used in data science and machine learning.
  2. Learn the basics of statistics and linear algebra: Understanding statistics and linear algebra will help you to better understand machine learning algorithms and models.
  3. Learn the basics of machine learning: Familiarize yourself with the basic concepts of machine learning such as supervised learning, unsupervised learning, and reinforcement learning.
  4. Start with simple projects: Begin with simple ML projects such as image classification or regression, and gradually work your way up to more complex projects.
  5. Explore different ML tools and frameworks: Try out different ML tools and frameworks such as TensorFlow, PyTorch, and Scikit-learn to find the ones that work best for you.
  6. Join online communities: Join online communities such as GitHub, Stack Overflow, and Reddit to connect with other developers and learn from their experiences.

Take a look at Tensorflow, PyTorch, OpenCV, Keras, Caffe2, SageMaker and Google Cloud AI. Any other tools we should consider?

  1. Microsoft Cognitive Toolkit (CNTK): CNTK is an open-source toolkit developed by Microsoft for building deep learning models. It supports a wide range of deep learning algorithms and can be used for training models on both CPUs and GPUs.
  2. MXNet: MXNet is a popular deep learning framework developed by Amazon Web Services (AWS). It supports both symbolic and imperative programming and provides a high-level API for building ML models.
  3. Theano: Theano is a popular Python library for building deep learning models. It provides a low-level API for building neural networks and supports both CPUs and GPUs.
  4. Hugging Face: Hugging Face is a popular open-source library for natural language processing (NLP) tasks. It provides pre-trained models for a wide range of NLP tasks, including text classification, question-answering, and language translation.
  5. ONNX: ONNX (Open Neural Network Exchange) is an open-source format for representing deep learning models. It allows you to build and train models in one framework and then deploy them in another, making it easier to switch between different ML frameworks.
  6. Apache Spark: Apache Spark is a popular distributed computing framework that can be used for large-scale data processing and machine learning tasks. It provides tools for distributed data processing, machine learning, and graph processing.

Wider thoughts on A.I. and Machine Learning

A.I. is a bigger concept to create intelligent machines that can simulate human thinking capability and behavior, whereas, Machine Learning is an application or subset of AI that allows machines to learn from data without being programmed explicitly. It is common for

Machine Learning in Big Data Era

Data is important to make sense of the world. We use data to forecast weather, to predict the location of the next earthquakes, to analyze the market and plan our next strategic move for our business, and to see all developments and trends on the social level.

Traditionally, humans analyze the data manually. As we enter the big data era, where, sometimes, data is measured in Terabytes, the amount of data grows beyond human’s ability to make sense of it. We seek the help of computers to try to automate the process of understanding and utilizing data. Machine learning is this automated system that learns from data and, most importantly, the changes in data.

The definition of machine learning can be simplified to five words: using data to answer questions. These five words can be separated into two parts: using data and answering questions. Using data is called training, and answering questions is the part of prediction.

Seven steps of machine learning are:

  1. Data gathering — Quantity and quality of the date determine the accuracy of the prediction.
  2. Data preparation — In this step, we prepare our data for training. Common practices include removing duplicates, correcting errors, dealing with missing values, normalization, and data type conversions. Randomizing data can help erase effects of orders in which we collected the data.
    To prepare for testing models, we split the data into two sets: training set and evaluation set. A good train/eval split is usually about 80/20 to 70/30, depending on domain, data availability, dataset particulars, etc.
  3. Choosing model — Different algorithms are suitable for different tasks, and we should choose the model that best fit our goals.
    For example, with linear regression algorithm (covered more details later, in common machine learning algorithm part), the model is a straight line.
  4. Training — In this step, we try to best fit the data with the model we chose. Using the former example of linear regression algorithm, we would need to learn the k and b that yield the least value to describe the model as y = kx + b.
  5. Evaluation — To measure the objective performance of the model, we test new data (the evaluation set that we didn’t use during training) on the model and see how good the predictions are.
  6. Parameter tuning — This step usually refers hyperparameter tuning. We tune the parameters used during training to achieve better accuracy during evaluation and better prediction performance. Simple model hyperparameters may include: number of training steps, learning rate, initialization values and distribution, etc.
  7. Prediction — Make predictions in the real world.

References: Frameworks for Approaching the Machine Learning Process. https://www.kdnuggets.com/2018/05/general-approaches-machine-learning-process.html

Types of Machine Learning

There are three types of commonly used machine learning: Supervised learning, Unsupervised learning, and Reinforcement learning.

Supervised learning uses labeled data to train machine learning algorithms. Labeled data means that the output is already known to you. The model simply needs to map the input to the output. This type of machine learning is commonly used in object recognition.

Unsupervised learning uses unlabeled data to train machines. The output is not given, so machines have to understand patterns and trends in the data and discover the output.

Reinforcement learning uses an agent and an environment to produce actions and rewards. It follows trial and error method to arrive at the desired solution. For example, a reward is given if the program answered correctly.

Different types of machine learning take advantages of different machine learning algorithms. In this graph, you can see which algorithm is commonly used by types of machine learning.

Neural Networks

Neural networks, also known as artificial neural networks (ANNs) or simulated neural networks (SNNs), are a subset of machine learning. They are central to deep learning algorithms. These computing systems are inspired by the biological neural network that constitute our brain, and they mimic the way that biological neurons signal to one another.

To explain how neural networks work, we take the example of one the most popular project that uses this algorithm, handwritten number recognition.

We will first explore the big picture and then dive deeper into what each steps do.

Big picture:

The first layer represent the number nine. And what is lit up in one layer depends on what is lit up in the previous layer. Going down one layer by layer, we will reach the final layer where we determine which number is the mostly likely.

What to do in each step:

  1. First put the written number in a 28*28 pixel graph. Represent it with numbers showing gradients, using 1 to represent white and 0 to represent black. The 28*28 pixels represent the first layer.
  2. What is lit up in one layer depends on what is lit up in the previous layer.
  3. For example, in the graph above, the second layer represents segments of the number nine. We can think of every node as connecting to all the nodes in the previous layer, and the weights represent the strength of the connections. Green represents positive numbers and red represents negative. In the first graph below, a green part corresponding to the inner part of the edge and a red part corresponding to the outer, representing green and red as a matrix and timing it with the original gradient can give us the possibility of that edge existing.
  4. The third layer detects what parts are represented. Using the example of recognizing the number nine, it consists of a circle on the top and a line on the bottom.
  5. And the final layer detects what number is the most possible. Possibility is shown as gradient. We take the number with the highest possibility.

Note: Sigmoid is a function that transfer high numbers to one and low numbers to zero.

GANs

GANs stands for generative adversarial networks. It is a class of machine learning frameworks designed by Ian Goodfellow and his colleagues in 2014. In GANs, there are two neural networks that play against each other: one is called the generator, the other is the discriminator. The generator plays the role of counterfeiter, and the discriminator plays the role of cop. The generator tries to fool the cop, and the discriminator tries to catch fraud.

The training process of the generator and the discriminator uses log-loss error function. The discriminator hopes to classify all data that the generator generated as 0, which represents false, so it uses the function below, which will produce a low error near 0 and a high error further away from 0:

On the other hand, the generator hopes produce data that will be classified as 1, which represents true data. The function below serves this purpose by producing a low error near 1 and a high error near 0:

To summarize, the error function that the discriminator use is:

- ln ( 1 — D ( G ( z ) ) ), where G represents generator and D represents discriminator. And the error function that the generator use is:

- ln ( D ( G ( z ) ) ).

And GANs will use these two functions to update weights respectively in the two neural networks.

Examples of GANs in action.

One of the most famous application of GANs is face generation. On this website, https://thispersondoesnotexist.com/, all images are of people that don’t exist. All images here are fully generated by neural network.

A.I. and Us

We have now reached a solid understanding of machine learning, so the rest of the article will deal with the topic of A.I. What is the definition of A.I.? what are its benefits for our society? And what are the drawbacks and the potential limits?

Artificial Intelligence is a branch of computer science that deals with the simulation of intelligent behavior in computers. Three main advances enabled us to make progress in this field: Massive data, Massive computing power, and New and more sophisticated machine learning algorithms.

Will A.I. outsmart human? Some believe yes. Now, we have already seen A.I. outsmarting humans on chess game and GO. But A.I. also has a long way to go. Self-driving cars are still not matured enough to be on the road, smart robots are not fully present in our daily life, and machines also lack creativity: we have rarely heard of robots composing novels. But still, let’s keep in mind that, in the field that A.I. is good at, it has far exceeded the ability of any human beings. And A.I. will get smarter and smarter.

Benefits of A.I. and examples of successful projects:

Many people believe that the benefits of A.I. outweigh the risks, and our future lies in humans working together with A.I.

We can already see so many benefits of using A.I. as a replacement for some tasks:

  1. Increase productivity. If we apply the technology of A.I. for rather repetitive work, people won’t need to do menial tasks and can focus on big-picture strategy.
  2. Better decision making. Machines, unlike humans, are not clouded by emotions. This characteristic will allow machines to make the most rational decisions.
  3. Personalization. A.I. can collect data and deliver more personalized experiences which will be very time-consuming for humans to do.
  4. Increased accuracy. A.I, unlike humans, will not get tired or be distracted, and it has the potential to be error-free.

Some of the world’s most successful A.I. projects include:

  1. Speech Interpretation and Recognition Interface. Siri. Apple’s personal assistant, which uses machine-learning technology to get smarter and better able to predict and understand our natural-language questions and requests. A similar project is Alexa, a virtual assistant AI technology developed by Amazon for the use of smart home. It Decipher speech from anywhere in the room to help scour the web for information, shop, schedule appointments, set alarms and a million other things, and also help power smart homes and be a conduit for those that might have limited mobility.
  2. Self-driving cars. One of the most famous company developing self-driving cars is Tesla. Self-driving cars combine a variety of sensors to perceive their surroundings and interpret sensory information to identify navigation paths and other relevant information.
  3. Projects of Prediction.
  • Netflix. Predicate movies you like by analyzing your previous action and choices of films.
  • Pandora. Predicate music you like.
  • Nest. Uses behavioral algorithms to predictively learn from your heating and cooling needs, thus anticipating and adjusting the temperature in your home or office based on your own personal needs.
  • Amazon. Predicate what you want to buy based on your previous buying and browsing history.

Limits of A.I.

As talked about in the opening of the article, many have a fear in the technology of A.I. And to be fair, this field is controversial and have drawbacks that are clear to us even today.

Potential dangers and challenges of A.I.:

  1. Security and privacy. A.I. needs a huge amount of, perhaps, personal data to be effective.
  2. The lack of rules and regulations. What A.I. can be used for? What A.I can control? What information does it have access to? What to do when something goes wrong? Questions such as these need to be answered. An example of this would be if there are two persons crossing the street in front of a self-driving car, which is at the speed of impossible to slow down to avoid hitting the two pedestrians. It must hit one. Which one?
  3. Challenging to the status quo. Many companies are not ready to switch to A.I and many people are not ready to be working with A.I.
  4. Job replacements. This is the discussion that goes back to whether A.I. can outsmart humans. Will A.I. be capable of so many jobs that human effort will be meaningless?

References:

  1. Types Of Machine Learning | Machine Learning Algorithms | Machine Learning Tutorial | Simplilearn. https://www.youtube.com/watch?v=olFxW7kdtP8
  2. Naive Bayes, clearly explained!!! https://www.youtube.com/watch?v=O2L2Uv9pdDA
  3. What is machine learning? https://www.youtube.com/watch?v=HcqpanDadyQ
  4. The seven steps of machine learning. https://www.youtube.com/watch?v=nKW8Ndu7Mjw
  5. Types Of Machine Learning | Machine Learning Algorithms | Machine Learning Tutorial | Simplilearn. https://www.youtube.com/watch?v=olFxW7kdtP8
  6. Naive Bayes, clearly explained!!! https://www.youtube.com/watch?v=O2L2Uv9pdDA
  7. How far is too far? | The age of A.I. https://www.youtube.com/watch?v=UwsrzCVZAb8
  8. Will AI outsmart humans? | Mateja Jamnik | TEDxKlagenfurt https://www.youtube.com/watch?v=uG3AZsXQ1fY
  9. AI: What Is it, What Are The Benefits & Challenges And What You Can Do To Prepare For It. https://www.youtube.com/watch?v=zs26A5qVFA4
  10. 10 Powerful Examples Of Artificial Intelligence In Use Today. https://www.forbes.com/sites/robertadams/2017/01/10/10-powerful-examples-of-artificial-intelligence-in-use-today/?sh=6b2764c6420d
  11. Supervised vs. Unsupervised Machine Learning: What’s the Difference? https://www.youtube.com/watch?v=rHeaoaiBM6Y
  12. Supervised vs Unsupervised vs Reinforcement Learning | Machine Learning Tutorial | Simplilearn. https://www.youtube.com/watch?v=1FZ0A1QCMWc&t=217s
  13. Unsupervised learning explained. https://www.youtube.com/watch?v=lEfrr0Yr684
  14. But what is a neural network? | Chapter 1, Deep learning. https://www.youtube.com/watch?v=aircAruvnKk
  15. Gradient descent, how neural networks learn | Chapter 2, Deep learning. https://www.youtube.com/watch?v=IHZwWFHWa-w
  16. Top 10 Neural Network Architectures in 2021 ML Engineers Need to Learn.https://www.upgrad.com/blog/neural-network-architectures/
  17. Neural network and deep learning by Michael Nielson. http://neuralnetworksanddeeplearning.com/
  18. A Friendly Introduction to Generative Adversarial Networks (GANs). https://www.youtube.com/watch?v=8L11aMN5KY8
  19. TensorFlow In 10 Minutes | TensorFlow Tutorial For Beginners | Deep Learning & TensorFlow | Edureka. https://www.youtube.com/watch?v=tXVNS-V39A0
  20. Top 20 movies about Artificial Intelligence and Big Data. https://towardsdatascience.com/top-20-movies-about-machine-learning-ai-and-data-science-8382d408c8c3
  21. Frameworks for Approaching the Machine Learning Process. https://www.kdnuggets.com/2018/05/general-approaches-machine-learning-process.html
  22. What are neural networks? https://www.ibm.com/cloud/learn/neural-networks#:~:text=Neural%20networks%2C%20also%20known%20as,neurons%20signal%20to%20one%20another.
  23. Neural Networks. https://g.co/kgs/1phphc
  24. Common Crawl, the datalake needed to train your AI. https://www.commoncrawl.org/

A little about us: OnDemandWorld Team, we are working on a new blockchain and AI app solutions. Niftnack NFT and TechHub Jobs. MVP already on App Store and Google Play. We are building the first scalable version now. Looking for new junior devs, blockchain devs, full-stack devs, etc. Contact us for more information. Remote working mostly in 2022 unless you are in Shanghai already.

--

--

Edward Tsang

Experienced technologist, focused on selective combinations of blockchain and AI. I use Medium to repost what I share on https://evolvingviews.com.