TensorFlow Lite在ML模型处理数值数据时有用吗?

2024-10-16 20:50:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用Android和Spring开发一款智能移动温控器,优化和节能。一个ML模型应该应用于springboot应用程序,它是Android应用程序将要与之通信的服务器。你知道吗

为了创建一个ML模型,我需要提供数据集,其中包括历史平均室外温度、当前室外温度和应定期更新的室温、建筑物的传热系数、房间面积和容积以及与平均房间大小有关的采暖季节的平均能量(热量)使用。你知道吗

因此,我想知道这个工具(TensorFlow Lite)是否有用,特别是什么AI方法和算法最适合这个应用程序来处理数值数据和创建模型,根据用户的喜好(精确的温度,达到预期效果的时间,节约能源)。如果需要的话,如果你能给我一些其他的建议,我将不胜感激。你知道吗


Tags: 模型服务器应用程序智能历史温度mlandroid
1条回答
网友
1楼 · 发布于 2024-10-16 20:50:47

TensorFlow Lite是在Android上运行ML模型(支持的操作有限)的最佳方式。我个人用过图像分类here。你知道吗

TensorFlow Lite is the successor of TensorFlow Mobile which is currently deprecated but is still used.

在您的问题中,您有一些特性,标签是二进制的(0表示关闭,1表示打开)。 你可以收集一些数据并在上面训练Keras模型。你知道吗

Keras is an open source neural-network library which is also build on TensorFlow and is available in tf.keras module.

你可以在他们的网站上找到这些教程。将模型保存到.h5文件后,需要将其转换为.tflite文件,这是我们的TensorFlow Lite模型。看这个file。你知道吗

converter = tf.lite.TFLiteConverter.from_keras_model_file( keras_model_path )
tflite_buffer = converter.convert()
open( tflite_file_path , 'wb' ).write( tflite_buffer )

您可以将此模型保存在应用程序的assets文件夹中,并使用Interpreter类将其加载到Android中。你可以看到这个file。你知道吗

你可以看到应用程序“皮肤”。它使用TensorFlow Lite。Python项目是here,Android项目是here。你知道吗

提示:

当您使用服务器这个词时,有TensorFlow.js可用,它使ML模型成为JavaScript。 您也可以在其中加载Python模型。你知道吗

另外,您已经在Firebase ML Kit上托管了您的模型。你知道吗

希望有帮助。你知道吗

相关问题 更多 >