我正在开发一款在 Android 和 Spring 中优化和节能的智能移动恒温器。 ML 模型应该应用于 Spring Boot 应用程序,该应用程序将成为 Android 应用程序要与之通信的服务器。
为了创建一个机器学习模型,我需要提供数据集,其中包括历史平均室外温度、当前室外温度和室温(应定期更新)、建筑物的传热系数、房间面积和体积以及平均能量(热量) )在供暖季节使用,与平均房间面积有关。
因此,我想了解这个工具(TensorFlow Lite)是否有用,特别是哪些人工智能方法和算法最适合这个应用程序来处理数值数据并创建控制炉子何时打开的模型根据用户的喜好(精确的温度、获得所需结果的时间、节省能源)关闭。如果需要的话,如果您能给我一些其他建议,我将不胜感激。
最佳答案
TensorFlow Lite尤其是在 Android 上运行 ML 模型(支持的操作有限)的最佳方式。我个人在图像分类中使用过here .
TensorFlow Lite is the successor of TensorFlow Mobile which is currently deprecated but is still used.
在您的问题中,您有一些功能并且标签是二进制的( 0 表示 OFF , 1 表示 ON )。 您可以收集一些数据并在其上训练 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 .
您可以看到“Skinly”应用程序。它使用 TensorFlow Lite。 Python项目是here Android项目是here .
提示:
当您使用“服务器”这个词时,有 TensorFlow.js可用,这使得 JavaScript 中的 ML 模型可用。 您也可以在其中加载 Python 模型。
此外,您已将模型托管在 Firebase ML Kit 上.
希望有帮助。
关于java - TensorFlow Lite 在机器学习模型处理数值数据方面有用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55851814/