项目作者: MyCodeBits

项目描述 :
Simple Gradient Descent implementation.
高级语言: Python
项目地址: git://github.com/MyCodeBits/GradientDescent-TheMathOfIntelligence.git


Demo_GradientDescent

Implemented a basic code for Gradient Descent as part of Siraj Rawal’s course Intro - The Math of Intelligence

Code referenced from : https://github.com/llSourcell/Intro_to_the_Math_of_intelligence

Gradient descent visualization

https://raw.githubusercontent.com/mattnedrich/GradientDescentExample/master/gradient_descent_example.gif

Dependencies

  • numpy

    Use pip to install any dependencies.

Dataset used

  • data.csv file of the form :

    x,y

    Example:

    1. distance cycled(miles), calories burned(KCal)
    2. 32.502345269453031, 31.70700584656992
    3. 55.142188413943821, 78.211518270799232
    4. ........ , .......

Usage

  • Used hardcoded data.csv for data.

  • To run:

    1. $ python3 demo.py
    2. Starting gradient descent -> initial_b = 0, initial_m = 0, initial_error = 5565.10783448
    3. Running...
    4. After 1000 iterations -> final_b = 0.116832206834, final_m = 1.4771976436, final_error = 112.5981953