项目作者: AndrewJBateman

项目描述 :
Tensorflow in angular8.
高级语言: TypeScript
项目地址: git://github.com/AndrewJBateman/angular-tensorflow-notes.git
创建时间: 2019-06-26T16:45:57Z
项目社区:https://github.com/AndrewJBateman/angular-tensorflow-notes

开源协议:

下载


:zap: Angular TensorFlow Notepad

  • Code to experiment with machine learning using Tensorflow.js, starting with recognising numbers. Tutorial code from Fireship (see ref in ‘Inspiration’) cloned then updated to Angular 13. All dependencies updated. Requires some fixes to work, due to updates. The plan is to use this to try new Tensorflow ideas.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size
GitHub pull requests
GitHub Repo stars
GitHub last commit

:page_facing_up: Table of contents

:books: General info

  • TensorFlow.js is an open-source hardware-accelerated JavaScript library for training and deploying machine learning models.

:camera: Screenshots

Example screenshot

:signal_strength: Technologies

:floppy_disk: Setup

  • npm i to install dependenciesy

  • ng serve then navigate to port 4200.

:computer: Code Examples

  • tba
  1. async trainNewModel() {
  2. // Define a model for linear regression.
  3. this.linearModel = tf.sequential();
  4. this.linearModel.add(tf.layers.dense({units: 1, inputShape: [1]}));
  5. // Prepare the model for training: Specify the loss and the optimizer.
  6. this.linearModel.compile({loss: 'meanSquaredError', optimizer: 'sgd'});
  7. // Training data, completely random stuff
  8. const xs = tf.tensor1d([3.2, 4.4, 5.5, 6.71, 6.98, 7.168, 9.779, 6.182, 7.59, 2.16, 7.042, 10.71, 5.313, 7.97, 5.654, 9.7, 3.11]);
  9. const ys = tf.tensor1d([1.6, 2.7, 2.9, 3.19, 1.684, 2.53, 3.366, 2.596, 2.53, 1.22, 2.87, 3.45, 1.65, 2.904, 2.42, 2.4, 1.31]);
  10. // Train
  11. await this.linearModel.fit(xs, ys)
  12. console.log('model trained')
  13. }

:cool: Features

  • to follow

:clipboard: Status & To-Do List

  • Status: not compiling due to errors from tensorflow update to v3
  • To-Do: Correct: Namespace has no exported member, loadModel does not exist.., fromPixels does not exist.

:clap: Inspiration

:file_folder: License

  • This project is licensed under the terms of the MIT license.

:envelope: Contact