Learning the Basics of Deep learning, ChatGPT, and Bard AI

Sonia Singla 26 May, 2023 • 8 min read

Introduction

Artificial Intelligence is the ability of a computer to work or think like humans. So many Artificial Intelligence applications have been developed and are available for public use, and chatGPT is a recent one by Open AI.

ChatGPT is an artificial intelligence model that uses the deep model to produce human-like text. It predicts the next word in a text based on the patterns it has learned from a large amount of data during its training process. Bard AI is too AI chatbot launched by google and uses recent work so can work to answer real-time questions.

We will discuss chatGPT and Bard AI and the difference between them.

Learning Objectives

1. Understanding the Deep Learning Model and chatGPT.

2. To understand the difference between chatGPT and Bard.

This article was published as a part of the Data Science Blogathon.

Understanding the Deep Learning Model

Artificial Intelligence is a broad term in today’s world to do everything and behave like a human. When we talk about the algorithm, we are, in other words, talking about a subset of Artificial Intelligence, Machine learning.

Machine learning algorithms look at the past behavior of humans and predict it based on past behavior. When we go further deep, some patterns are adapted or learned themselves when the situation is different. “Deep Learning” further deep algorithms, following the footsteps of neural networks.

“Deep Learning Algorithm” is classified into two Supervised and Unsupervised. “Supervised Learning” is divided into Convolutional Neural Network (CNN) and Recurrent neural networks.

In supervised learning, the data given in input is labeled data. In Unsupervised learning, the data is unlabeled and works by finding patterns and similarities.

DEEP LEARNING

Artificial Neural Network (ANN)

Similarly, like a human brain, an input layer, one or more hidden layers, and an output layer make up the node layers of artificial neural networks (ANNs). There is a weight and threshold associated with each artificial neuron or node. When a node’s output exceeds a predetermined threshold, it is activated and sends data to the next layer. Otherwise, no data reaches the next layer.

After an input layer, weights get added. Larger weights contribute more to the output than other inputs. The mass of the input layer gets multiplied, and then the results are added up. After that, the output result is by the activation function, which decides what to do with it. The node is activated if that output exceeds a certain threshold, transmitting data to the next layer. As a result, the input layer of the next layer consists of the output return of the past one and is thus named feed-forward.

"ann

Let’s say that three factors influence our decision, and one of the questions is if there is a rainy day tomorrow, and if the answer is Yes, it is one, and if the response is no is 0.

Another question will there be more traffic tomorrow? Yes-1, No -0.

The last question is if the beachside will be good for a picnic. Yes-1, No-0.

We get the following responses.

where

– X1 – 0,

– X2 – 1,

– X3 – 1

Once the input is assigned, we look forward to applying weight. As the day is not rainy, we give the mass as 5. For traffic, we gave it as 2, and for a picnic as 4.

  • W1 – 5
  • W2 – 2
  • W3 – 4

The weight signifies the importance. If the weight is more, it is of the most importance. Now we take the threshold as 3. The bias will be the opposite value of the threshold -3.

y= (5*0)+(1*2)+(1*4)-3 = 3.

Output is more than zero, so the result will be one on activation. Changes in the weights or threshold can result in different returns. Similarly, neural networks make changes depending on the results of past layers.

For example, you want to classify images of cats and dogs.

The image of a cat or dog is the input to the neural network’s first layer.

After that, the input data pass through one or more hidden layers of many neurons. After receiving inputs from the layer before it, each neuron calculates and sends the result to the next layer. When determining which characteristics, the shape of the ears or the patterns, set apart cats from dogs, the neurons in the hidden layers apply weights and biases to the inputs.

The probability distribution of the two possible classes, cat and dog, is the return for final layers, and prediction ranks higher than probability.

Updating weights and biases is termed backpropagation, and it improves at the time in pattern recognition and prediction accuracy.

Facial Recognization by Deep Learning

We will use animal faces to detect digitally based on a convolutional.

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import *
from tensorflow.keras.models import Model
from tensorflow.keras.applications import InceptionV3
from tensorflow.keras.layers import Dropout, Flatten, Dense, Input
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import numpy 
import pandas 
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
import patoolib
patoolib.extract_archive('animals.zip')
image = plt.imread("C://Users//ss529/Anaconda3//Animals//train//cat//flickr_cat_000002.jpg")
plt.imshow(image)
CODE OUTPUT
train_data = ImageDataGenerator(rescale = 1./255)
test_data = ImageDataGenerator(rescale = 1./255)
train_dir= ("C://Users//ss529/Anaconda3//Animals//train")
val_dir = ("C://Users//ss529/Anaconda3//Animals//val")
train_generator = train_data.flow_from_directory(
                  train_dir,
                  target_size =(150, 150), 
                  batch_size = 20,
                  class_mode ='binary')

test_generator = test_data.flow_from_directory(
                    val_dir,
                    target_size =(150, 150),
                    batch_size = 20,
                    class_mode ='binary')
from tensorflow.keras.models import Sequential 
from tensorflow.keras.layers import Dense,Flatten
model = Sequential()

model.add(Flatten(input_shape=(150, 150,3)))
model.add(Dense(4,activation='sigmoid'))
model.add(Dense(5,activation='relu'))
model.add(Dense(3,activation='softmax'))

model.summary()
"CODE OUTPUT
opt = tf.keras.optimizers.Adam(0.001)
model.compile(loss='sparse_categorical_crossentropy', optimizer=opt, metrics=['accuracy'])
model.fit(train_generator,epochs=5, validation_data= test_generator)

What is ChatGPT?

An up-to-date Artificial Intelligence chatbot, trained by Open AI, developed on Azure that answers your queries, except for mistakes, corrects the code, and can reject unnecessary demands. It depends on a Generative pre-trained transformer equipment GPT 3.5, which uses Artificial or complex work to approach and make out with words.

ChatGPT, which stands for chat-based Generative Pre-trained transformer, is a potent tool that works in different ways to increase output in several distinct areas.

The artificial intelligence (AI) research and development firm OpenAI developed the natural language processing (NLP) model called ChatGPT. It analyzes and grasps written or spoken language using machine learning algorithms and then generates responses based on that input. Because it is pre-trained on a large amount of text data, ChatGPT can make out the context and meaning of words and phrases
and generate contextual responses that are highly relevant.

ChatGPT is intelligent to solve simple math problems and answer query-related technical or even some jokes.

For example, the image below shows some funny jokes generated by AI.

"ChatGPT

In another example, the image below shows to find the area of a triangle with the help of AI.

"ChatGPT

How to Use ChatGPT?

Here we are going to answer some questions related to chatGPT.

Anyone can use ChatGPT for free. One can sign up and log in using google or email. The free version of ChatGPT is open to the general as of the writing date of February 2023.

"ChatGPT

“ChatGPT Plus” is a paid subscription plan. It gives priority access to new features, faster response times, and reliable availability when demand is high.

ChatGPT is quick and easy to use. Open the browser https://chat.openai.com/ and type the question or your queries.

For example, I asked some business and idea tips on Data Science, and here is the response provided by chatGPT in the below image.

"ChatGPT

Why Should we Use chatGPT?

chatGPT can give you the best services based on how you want to use a chatbot for your benefit.

  1. It can write for your document or reports.
  2. It is possible to save time and allow messages straight given and professionally by using ChatGPT to generate personalized and engaging responses.
  3. Teams can use ChatGPT to better make data-driven decisions by analyzing
    large amounts of data and identifying key trends and insights.
  4. It can help generate new business ideas that assist business leaders and entrepreneurs with original and creative concepts for new projects, schemes, and services.
  5. ChatGPT can come in handy for detection and correction in existing code.

GitaGPT was developed by using Artificial Intelligence to answer queries related to Bhagavad Gita on the website https://bhagavadgita.ai/

Limitations Of ChatGPT

ChatGPT does not so far shows 100% accuracy.

For example,  for the question about Male Rao Holkar’s death, the response from chatGPT is not similar to the history.

"
"ChatGPT

Edward Tiann, a 22 years old student from Princeton University, developed the GPTZero application that can detect plagiarism with the contents texted by AI. It is so far for educational use, and the beta version is ready for public use.

What is Bard AI?

LaMDA (Language Model for Dialogue Applications) powers Bard, an experimental conversation AI service. To respond to queries in a new and high-quality way, it uses data from the Internet.

How does Bard function?

LaMDA, a large language model created by Google and released in 2021, powers Bard. Bard is made available by Google on a thin-weight version of LaMDA, which requires less computing power to run, allowing it to reach a maximum number of users.

The Difference Between ChatGPT and Bard

Google Bard AI and chatGPT are the chatbots that use AI for a chat.

  1. ChatGPT is available and open to the public. Bard is limited to beta testers and not for public use.
  2. For chatGPT service has paid and free options. Bard service is available for free.
  3. Bard uses the langauge model developed by google in 2021 and that of chatGPT, a pre-trained transformer.
  4. ChatGPT has a GPT -2 Output detector that detects plagiarism, and Bard has not.
  5. ChatGPT will search for texts and sources that did exist in 2021. Bard on recent sources that can fetch more data. The Google search engine will undergo some settings to let Bard AI answer.

Frequently Asked Questions

Q1. What algorithm does the ChatGPT use?

A. ChatGPT is built on the GPT-3.5 architecture, which utilizes a transformer-based deep learning algorithm. The algorithm leverages a large pre-trained language model that learns from vast amounts of text data to generate human-like responses. It employs attention mechanisms to capture contextual relationships between words and generate coherent and contextually relevant responses.

Q2. How is ChatGPT programmed?

A. ChatGPT is programmed using a combination of techniques. It is built upon a deep learning architecture called GPT-3.5, which employs transformer-based models. The programming involves training the model on a massive amount of text data, fine-tuning it for specific tasks, and implementing methods for input processing, context management, and response generation. The underlying programming techniques involve natural language processing, deep learning frameworks, and efficient training and inference pipelines.

Conclusion

ChatGPT is a new chatbot AI that surprised the world with its unique features to answer, solve problems, and detect mistakes.

Some of the key points we learned here

  1. ChatGPT, a new chatbot developed by Open AI, is the new google. For the question’s answers, we usually searched on google to find the answer can be done now on chatGPT, but still, it has less than 100% accuracy.
  2. ChatGPT works on deep learning models.
  3. Brad AI, developed by google in competition with chatGPT, will soon reach the public.

We will use animal faces to detect digitally based on a convolutional.

The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion.

Sonia Singla 26 May 2023

Frequently Asked Questions

Lorem ipsum dolor sit amet, consectetur adipiscing elit,

Responses From Readers

Related Courses