Meet My Project “TensorFlow.js in Angular”: Working on Angular-based Machine Learning Apps

Jorge Guerra Pires, PhD
JavaScript in Plain English
3 min readOct 17, 2021

--

Man vs. Machine

What is Angular?🤔

Angular is a framework, designed by the Google Team, and it has been widely used to design sites. Essentially, it is a framework to create frontends, based on TypeScript. In layman's terms: the page you see and interact on your web browser.

It is a framework to create frontends.

What is TensoFlow.js?🤔

TensorFlow.js is a JavaScript-based library for deep learning, based on the classical TensorFlow, written in Python; you can also do simple learning machine, some simple mathematical operations with tensors and so on. There are several reasons for using TensorFlow.js instead of Python, and I hope to come back to that in the future.

A nice point is that they claim it is possible to transform models in both directions: TensorFlow.js <-> TensorFlow.

It is possible to transform models in both directions.

Further, they claim the two libraries are similar, making it easier for programmers from both communities to work together, with no segregation, “us against them,” “what is better and worse,” etc. Let´s work and change the world instead of fighting!

Why I believe they go well together🤔

Please, see my articles here: “Why am I considering seriously JavaScript and Deep Learning? and I would suggest you to do so” and “MEAN + TensorFlow.js: a single language, a single data exchange format for machine learning-based web applications!

Goal

Adapting the codes from “ Deep Learning with JavaScript: Neural networks in TensorFlow.js” to Angular.

Hypothesis

Angular offers more powerful tools than plain JavaScript coding.

Some of the difficulties I am facing

  • I understand that TypeScript exists for a reason, but using TypeScript with TensorFlow.js has been a challenge. The biggest challenge is knowing the type of everything, otherwise, you cannot run anything. Sometimes, it can be hard to find that information, even on official documentation. The codes I am using are in plain JavaScript, no need to know about types (that is TypeScript’s expertise and it is called TYPEscript: it is an extension of JavaScript, strongly “typed”).
  • My Twitter is mentioned below, you can comment if you want! I know that with patience, as I have been maintaining, you can find anything, work around any difficulties; and with luck, someone else will solve the issue in the future.
My tweet wherein I speak about the fact that TypeScript may add some initial difficulties to using TensorFlow.js with Angular

Starting point: “ Deep Learning with JavaScript: Neural networks in TensorFlow.js”

on ResearchGate

A simple model using TensorFlow.js, for the classical Bouston Housing problem

Simulations using TensorFlow.js, using one neuron with no activation.

My tweet below, feel free to comment!

My tweet talking about the fact that learning machine today can do things that in the past seemed impossible. See the history of neural networks, quite intriguing

People are reacting to my tweet! Leave your impression too! 🙏❤💪

Tweet, with good engagement, wherein I talk about this project!

Follow me

Let’ keep in touch! 🙏❤💪🙏💕💕🎉

Article on Twitter, feel free to leave your reactions!

List of writings

Working on

  • Some types you may want to know for working with TensorFlow.js in TypeScript

Neural model for learning about artificial intelligence: using TensorFlow.js

Donations

Buy me a coffee ☕☕☕☕☕ or a book! 📚📚📚📚📚

If any of this content was useful to you! It is a one-time donation, no need to donate again!
https://www.buymeacoffee.com/jorgepires

Now you can also support any of my projects! 🥰🥰
More info: https://jorgeguerrabrazil.wixsite.com/ideacodinglab/publications

More content at PlainEnglish.io. Sign up for our free weekly newsletter. Follow us on Twitter and LinkedIn. Check out our Community Discord and join our Talent Collective.

--

--