Placeholder Image

字幕列表 影片播放

  • In this episode of tensorflow tip of the week, we'll look at how easy it is to incorporate tensorflow light into an android app.

  • This is Android studio with a simple empty app in it.

  • To use tensorflow light, the first thing that you need to do is add an implementation to your dependencies and build grader.

  • Also, make sure that you're a PT Options is set to know compress for T F light.

  • You'll also need to put your model into your assets folder.

  • Our model is called Linear because it in fares on a linear relationship of Y, equals two X minus one.

  • Now when your main activity there's also a few pieces of code that you'll need to add.

  • The first of these is to import the Tensorflow light interpreter.

  • Then you need to declare your interpreter object and you construct the interpreter, bypassing it.

  • A Function load model file, which loads the model from your assets folder as a map to bite Buffer.

  • This apple ready has a button on it called Unfair Button.

  • On its click handler.

  • You'll call a function called Do Inference, which uses the tensorflow light model.

  • You'll code that function next do inference receives an input string as the contents of an edit text.

  • When we pass our values to the neural network, we need to put them into an array.

  • This neural network just takes a single value, his input so we'll create that fromthe string that was sent into this function.

  • The output from the neural network is a two dimensional array, with one value in each access, so it's specified that next.

  • Then, to run the inference on the model, we simply called TF light dog run on passivity and put an output values.

  • TF Light then writes the results to the output value so we can read it out into a float, which we then return to the calling function.

  • Let's see what it looks like when we run it.

  • So, for example, if we import 10 the inferred value was 18.98 which is very closer to desired 19.

  • And for one, we unfair 1.6 which is also really close.

  • And that's not bad, considering this model was trained on only six items of data.

  • To learn more about tensorflow, visit tensorflow dot or GE on while you're at it.

  • Don't forget to subscribe to this channel.

In this episode of tensorflow tip of the week, we'll look at how easy it is to incorporate tensorflow light into an android app.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

將TensorFlow Lite添加到您的Android應用中(TensorFlow每週小貼士)。 (Add TensorFlow Lite to your Android App (TensorFlow Tip of the Week))

  • 3 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字