Skip to content

HeGanjie/icy-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icy-lab

Building my own "tensorflow", work in progress.

What I can't create, I don't understand.

How to play

  1. clone the project
  2. npm i
  3. edit src/index.js if you want
  4. node index.js

Demo

// code from src/index.js
const {pow} = Math
let sess = genSession()
console.log('x init: ', sess.run('x'))

let fn = x => pow(x - 5, 2)
let train = minimize(fn, 0.01)
let feed = {pow}
for (let i = 0; i <= 1000; i++) {
  sess.run(train, feed)
}
console.log(`min x for ${fn + ''} is:`, sess.run('x'))

run result:

x init:  0
minimize fn:  x => pow(x - 5, 2)
min x for x => pow(x - 5, 2) is: 4.999999991753459

License

MIT

About

machine learning toy program

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published