Code Monkey home page Code Monkey logo

tensorflow-cuadratic-model's Introduction

TensorFlow: approximation of a quadratic polynomial

This test model was created to approximate the quadratic polynomial f(x) = 2x² + x.

Model

The model is a generic second degree polynomial f(x) = ax² + bx + c.

Training data

The training data for this example is conformed by function evaluations (it does not have noise):

x = [0, 1, 2, 3, 4] y = [0, 3, 10, 21, 36]

Results

The final results after 5000 iterations is:

a: 2.00039, b: 0.998191, c: 0.00141833, loss: 2.84776e-06

This results are very close to the real values:

a: 2, b: 1, c: 0

Note

The parameter passed to GradientDescentOptimizer is the learning rate and inappropriate values could cause the algorithm to diverge. Try 0.01 in this code and see what happens.

tensorflow-cuadratic-model's People

Contributors

notsag-dev avatar

Stargazers

Diego Stratta avatar

Watchers

James Cloos avatar  avatar  avatar

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.