Giter VIP home page Giter VIP logo

idouble / deep-learning-machine-learning-ai-tensorflow-python Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 13.0 4.91 MB

๐Ÿ A Collection of Notes for Learning & Understanding Deep Learning / Machine Learning / Artificial Intelligence (AI) with TensorFlow ๐Ÿ

License: MIT License

Python 100.00%
ai deep-learning deep-neural-networks tensorflow tensorflow-examples python machine-learning machine-learning-algorithms understanding-neural-networks neural-networks weights biases summation inputs outputs tensor multidimensional-arrays artificial-intelligence artificial artificial-neural-networks

deep-learning-machine-learning-ai-tensorflow-python's Introduction

๐Ÿ Deep Learning / Machine Learning / Artificial Intelligence (AI) TensorFlow Python ๐Ÿ

๐Ÿ Deep Learning / Machine Learning / Artificial Intelligence (AI) with TensorFlow ๐Ÿ

Learning & Understanding Deep Learning / Machine Learning / Artificial Intelligence (AI).
I tried to keep it as short as possible, but Truth needs to be told, Deep Learning / Machine Learning and Artificial Intelligence (AI) are big topics.
In this Repository, the focus is mainly on TensorFlow and Deep Learning with neural networks.

What is a neural network? ๐ŸŒ

A basic neural network consists of an input layer, which is just your data, in numerical form. After your input layer, you will have some number of what are called "hidden" layers. A hidden layer is just in between your input and output layers.
One hidden layer means you just have a neural network. Two or more hidden layers? you've got a deep neural network!

neural network

What is a Tensor? ๐Ÿ”ข

Each operation takes a Tensor as an Input and outputs a Tensor. A Tensor is how Data is represented in TensorFlow.
A Tensor is a multidimensional array ex:

[0.245,0.618,0.382]

This would be a normalized one-way-tensor.

[[0.245,0.618,0.382],
[0.618,0.382,0.245],
[0.382,0.245,0.618]]

This would be a normalized two-way-tensor.

[[[0.245,0.618,0.382],[0.618,0.382,0.245],[0.382,0.245,0.618]],
[[0.245,0.618,0.382],[0.618,0.382,0.245],[0.382,0.245,0.618]],
[[0.245,0.618,0.382],[0.618,0.382,0.245],[0.382,0.245,0.618]]]

This would be a normalized three-way-tensor.

normalized in TensorFlow means that the numbers are converted to a value between 0 and 1.
The Data needs to be normalized, to be actually useable in TensorFlow.

neural network

Hyper Parameters ๐Ÿ”ก

Hyperparameters contain the data that govern the training process itself.

As an ex. if the learning rate is too big, our model may skip the optimal solution, if the learning rate is too small we may need to many iterations to get the best result, so we try to find a learning rate that fits for our purpose.

hyper parameters

What are Weights and Biases? ๐Ÿ”ค

Weights and Biases are the learnable parameters of your model. As well as neural networks, they appear with the same names in related models such as linear regression. Most machine learning algorithms include some learnable parameters like this.

explained picture machine learning

๐Ÿ“ Example Code with Comments ๐Ÿ“

import tensorflow as tf  # deep learning library. Tensors are just multi-dimensional arrays

mnist = tf.keras.datasets.mnist  # mnist is a dataset of 28x28 images of handwritten digits and their labels
(x_train, y_train),(x_test, y_test) = mnist.load_data()  # unpacks images to x_train/x_test and labels to y_train/y_test

x_train = tf.keras.utils.normalize(x_train, axis=1)  # scales data between 0 and 1
x_test = tf.keras.utils.normalize(x_test, axis=1)  # scales data between 0 and 1

model = tf.keras.models.Sequential()  # a basic feed-forward model
model.add(tf.keras.layers.Flatten())  # takes our 28x28 and makes it 1x784
model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))  # a simple fully-connected layer, 128 units, relu activation
model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))  # a simple fully-connected layer, 128 units, relu activation
model.add(tf.keras.layers.Dense(10, activation=tf.nn.softmax))  # our output layer. 10 units for 10 classes. Softmax for probability distribution

model.compile(optimizer='adam',  # Good default optimizer to start with
              loss='sparse_categorical_crossentropy',  # how will we calculate our "error." Neural network aims to minimize loss.
              metrics=['accuracy'])  # what to track

model.fit(x_train, y_train, epochs=3)  # train the model

val_loss, val_acc = model.evaluate(x_test, y_test)  # evaluate the out of sample data with model
print(val_loss)  # model's loss (error)
print(val_acc) # model's accuracy

Resources & Links: โ›“

https://www.tensorflow.org/
https://ai.google/education/
Deep Learning: https://pythonprogramming.net/introduction-deep-learning-python-tensorflow-keras/
TensorFlow Overview: https://www.youtube.com/watch?v=2FmcHiLCwTU
AI vs Machine Learning vs Deep Learning: https://www.youtube.com/watch?v=WSbgixdC9g8
https://www.quora.com/What-do-the-terms-Weights-and-Biases-mean-in-Google-TensorFlow
https://datascience.stackexchange.com/questions/19099/what-is-weight-and-bias-in-deep-learning

Binance Ready to give crypto a try ? buy bitcoin and other cryptocurrencies on binance

deep-learning-machine-learning-ai-tensorflow-python's People

Contributors

idouble avatar imgbotapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

deep-learning-machine-learning-ai-tensorflow-python's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.