2

I want to use deep learning or machine learning to do some calculations on my front-end.

But there are no react examples.

My original idea was use python with react. Tensorflow would run in back-end in Python, while the front-end would be using React and get the results from the Python back-end.

Then I saw that Tensorflow is also in Javascript. So it can be used directly on the website, right?

Can React then directly use Tensorflow?

1
  • 2
    Yes you can, however - React has nothing to do with Tensorflow js, React is just a UI library, Tensorflow is a Machine learning library. There's nothing stopping you from using both, and there's no need to have a "wrapper" like answer below suggests Commented May 8, 2018 at 21:58

2 Answers 2

8

Yes you can install it NPM, it is at their documentation: https://js.tensorflow.org/setup/

yarn add @tensorflow/tfjs or npm install @tensorflow/tfjs

Then import * as tf from '@tensorflow/tfjs';

Hope that helps

Sign up to request clarification or add additional context in comments.

Comments

0

Yes you can, TensorFlow.js is designed for just this use case. You may need to find some React wrapper libraries or wrap it up yourself but it is completely possible.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.