Note : All code files will be available at https://github.com/ashwinhprasad/Tensorflow-2.0
This blog post will cover some basic functions that will be repeatedly used a lot in tensorflow 2.
random.normal generates random values of the given shape, which follow normal distribution
and random.uniform generates random values in such a way that probability of choosing any number from the random bunch is almost uniform
x1 = tf.random.normal(shape=(5,5),mean=0,stddev=1)
[[-1.1473149e+00 5.1616412e-01 -2.8656033e-01 …
Tensorflow is a DeepLearning library which has a lot of inbuilt classes and functions which allow you to perform these complex deep learning matrix multiplications and gradient calculations easily. The main Goal behind tensorflow is to make developing machine learning models easier and get it to a production environment.
As everyone already know, The updated version of tensorflow allows the user to create models easily whereas it was quite difficult with tensorflow’s first version.
You could directly use tensorflow from google colab (I prefer this) or type
“pip install tensorflow” for windows users and
“pip3 install tensorflow2” for linux users
Tensors are simply n-dimensional arrays. …
sorry for misspelling network , lol.
All the code files will be available at : https://github.com/ashwinhprasad/PyTorch-For-DeepLearning
Recurrence Neural Network are great for Sequence data and Time Series Data. Long short-term memory is an artificial recurrent neural network architecture used in the field of deep learning. LSTMs and RNNs are used for sequence data and can perform better for timeseries problems.
An LSTM is an advanced version of RNN and LSTM can remember things learnt earlier in the sequence using gates added to a regular RNN. Both LSTM’s and RNN’s working are similar in PyTorch. …
Note : All the code files will be available at : https://github.com/ashwinhprasad/SentimentAnalysis
Sentiment analysis in simple words is basically analysing how an user feels about an item or any other thing from the user’s activity such as reviews , tweets, etc.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
2. Downloading NLTK
Use the nltk shell to download the english stopwords.
3. Importing the dataset
df = pd.read_csv('IMDB Dataset.csv')
As you can see, there are some html tags in reviews
4. Beautiful Soup
#remove html tags
from bs4 import BeautifulSoup
for i in range(df.shape):
df['review'][i] = BeautifulSoup(df['review'][i], "lxml").text …
Recommender systems are the systems that are designed to recommend things to the user based on many different factors
Pearson’s Correlation Coefficient is a very simple yet effective way to find how 1 variable linearly changes with respect to another. we can use this to our advantage and build a recommender system with this concept
If correlation coefficient is closer to 1 for two variables, these variables are directly proportional to each other.
If it is closer to -1 , these variables are inversely proportional to each other.
If the magnitude of the correlation coefficient is lower or closer to 0, the variables are probably don’t have a strong dedpendency with respect to each other. …
Note: All the code files will be available at : https://github.com/ashwinhprasad/Chatbot-GoingMerry
Going Merry is a chatbot that I created for a pirate recruitment process. It helps in recruitment of pirates all around the world. this answer user’s simple questions regarding the recruitment process, pre-requisites, etc.This same model can also be used for creating chatbots for any organization
A chatbot is a software application used to conduct an on-line chat conversation via text . In this blog post, I will show how to create a Simple Chatbot with tensorflow 2 for your organization.
once, the dataset is built . half the work is already done. the way we structure the dataset is the main thing in chatbot. I have used a json file to create a the dataset. …
All the code files will be available at : https://github.com/ashwinhprasad/Outliers-Detection/blob/master/Outliers.ipynb
Anything that is unusual and deviates from the standard “normal” is called an Anomaly or an Outlier.
Detecting these anomalies in the given data is called as anomaly detection.
For more theoretical information about outlier or anomaly detection, Check out : How Anomaly Detection Works ?
Case 1 : Consider a situation where a big manufacturing company is manufacturing an airplane. An airplane has different parts and we don’t want any parts to behave in an unusual way. …
Before we begin about K-Means clustering, Let us see some things :
1. What is Clustering
2. Euclidean Distance
3. Finding the centre or Mean of multiple points
If you are already familiar with these things, feel free to skip to K-Means algorithm
Clustering is nothing but grouping. We are given some data, we have to find some patterns in the data and group similar data together to form clusters . This is the basis of clustering.
This is done with the help of euclidean distance.
1. An athletic club might want to cluster their runners into 3 different clusters based on their speed ( 1 dimension )
2. A company might want to cluster their customers into 3 different clusters based on 2 factors : Number of items brought, no of items returned ( 2 dimensions…
In the previous post, we saw the introduction to opencv and some basic Image loading and stuff.
In this post, we are going to be creating our own images by drawing shapes and texts on an empty canvas
2. Creating an empty canvas
pixels with low intensity are black and very high intensity are white. Since, we know that pictures can be represented in terms of matrices , we are initialising a 3 dimensional matrix full of element 1. So, that we get a plain white image.
0 → Black
1 → White
3. Drawing a line
before, we start using opencv’s functions, one thing I wanted to say is the all of opencv’s functions are executed inplace. …
This is the start of a new series called “The OpenCV for Beginners”. In this blog post , we will be seeing about the basics of images and how to handle them with cv2 module in python.
The access the code files , check my github profile : My Github profile.
The repository will be update after the completion of the entire series.
OpenCV is a computer vision library that has functionalities that can be used to handle image and video data.
For Linux users:
pip3 install opencv-python
For windows users:
pip install opencv-python
Images are also data. Hence, they can be represented in forms of matrices.
In your school days , you might have studied that mixing red, green and blue in different proportions will result in different colours and these 3 colours can be used to create every colour in this world. …