[机器学习]AutoML --- AutoKeras
前 言
Keras 是一个用 Python 编写的高级神经网络 API,能够在 TensorFlow、CNTK 或 Theano 之上运行。它的意义在于可以实现快速实验。而能够以最小的延迟把想法变成结果是顺利进行研究的关键。
AutoKeras是一个开源的,基于 Keras 的新型 AutoML 库。AutoKeras 是一个用于自动化机器学习的开源软件库,提供自动搜索深度学习模型的架构和超参数的功能。AutoKeras 采用的架构搜索方法是一种结合了贝叶斯优化的神经架构搜索。它主要关注于降低架构搜索所需要的计算力,并提高搜索结果在各种任务上的性能。
官方网站:https://autokeras.com/
项目github:https://github.com/jhfjhfj1/autokeras
TensorFlow版本:https://github.com/melodyguan/enas
PyTorch 版本:https://github.com/carpedm20/ENAS-pytorch
安装Auto-keras
Note: currently, Auto-Keras is only compatible with: Python 3.6.
1 Auto-Keras依赖于Keras, Pytorch, Tensorflow组件,打开Anconda Prompt,输入以下命令:
pip install keras
pip install install pytorch
pip install tensorflow-gpu
等待安装完毕即可。
2 安装graphviz
此依赖包的目的是为了绘制Auto-Keras生成的网络结构,同样的输入以下命令:
pip install graphviz
3. 安装Auto-Keras
最后来安装Auto-Keras,输入命令:
pip install autokeras
Docker Env
1. Download Auto-Keras Docker image
docker pull garawalid/autokeras
2. Start Auto-Keras Docker container
docker run -it --shm-size 2G garawalid/autokeras /bin/bash
In case you need more memory to run the container, change the value of shm-size
. (Docker run reference)
3. Run application :
To run a local script file.py
using Auto-Keras within the container, mount the host directory -v hostDir:/app
.
docker run -it -v hostDir:/app --shm-size 2G garawalid/autokeras python file.py
Example :
Let's download the mnist example and run it within the container.
wget https://raw.githubusercontent.com/jhfjhfj1/autokeras/master/examples/mnist.py
Run the mnist example :
docker run -it -v "$(pwd)":/app --shm-size 2G garawalid/autokeras python mnist.py
K8S Env
1. specifies the tmpfs volume dshm.
2. enables POSIX shared memory for hello-container1 via dshm.
https://docs.okd.io/latest/dev_guide/shared_memory.html
apiVersion: v1
id: hello-autokeras
kind: Pod
metadata:name: hello-autokeraslabels:name: hello-autokeras
spec:volumes: - name: dshmemptyDir:medium: Memorycontainers:- image: garawalid/autokerasname: hello-container1ports:- containerPort: 8080hostPort: 6061volumeMounts: - mountPath: /dev/shmname: dshm
Create the pod using the shared-memory.yaml file:
$ kubelet create -f autokeras.yaml
Auto-Keras 使用示例
from keras.datasets import mnist
from autokeras import ImageClassifierif __name__ == '__main__':(x_train, y_train), (x_test, y_test) = mnist.load_data()x_train = x_train.reshape(x_train.shape+(1,))x_test = x_test.reshape(x_test.shape+(1,))clf = ImageClassifier(verbose=True, augment=False)clf.fit(x_train, y_train, time_limit=30 * 60)clf.final_fit(x_train, y_train, x_test, y_test, retrain=True)y = clf.evaluate(x_test, y_test)print(y * 100)clf.load_searcher().load_best_model().produce_keras_model().save('\my_model.h5')
运行代码,显示Auto-Keras正在不断进行迭代以寻找最优网络:
参考: https://towardsdatascience.com/auto-keras-or-how-you-can-create-a-deep-learning-model-in-4-lines-of-code-b2ba448ccf5e
[机器学习]AutoML --- AutoKeras相关推荐
- 自动化机器学习AutoML(1)
自动化机器学习AutoML 什么是AutoML 在过去十年内,机器学习领域获得了巨大的进展,得益于互联网(数据)与芯片(算力)行业的快速发展,各类机器学习算法终于化理论为实践,被应用当各行各业.千家万 ...
- 2019年,自动化机器学习AutoML技术还火吗? | BDTC 2019
整理 | 王银 出品 | AI科技大本营(ID:rgznai100) [导读]12 月 5-7 日,由中国计算机学会主办,CCF 大数据专家委员会承办,CSDN.中科天玑协办的中国大数据技术大会(BD ...
- 自动化机器学习(AutoML)文献/工具/项目资源大列表分享
本文整理了与自动化机器学习相关的经典论文.开源工具.项目.免费经典书籍.会议.经典文章和其他资源的列表. AutoML介绍 AutoML是使用机器学习方法和过程来自动化机器学习系统并使其更容易访问的相 ...
- 开源自动机器学习(AutoML)框架盘点
开发十年,就只剩下这套Java开发体系了 >>> 自从Google推出了能自动设计神经网络自我进化的AutoML论文后,我便开始持续关注这个领域 到目前为止,从网上显示的信息来 ...
- 轻松玩转自动机器学习AutoML:H2O Flow
想想我们每次创建机器学习模型时,编写多行代码是不是很累!虽然这里给大家总结了一个建立机器学习模型的万能模版,但还是累啊! 有没有想过,如果我们可以通过鼠标点击来构建机器学习模型会变得多么容易和高效?H ...
- 【机器学习】盘点常见的自动机器学习(AutoML)工具库
本文总结了常见的AutoML库,可供大家选择. LightAutoML 项目链接:https://github.com/sberbank-ai-lab/LightAutoML 推荐指数:⭐⭐⭐ Lig ...
- python automl_自动化的机器学习(AutoML):将AutoML部署到云中
编辑推荐: 在本文中,将介绍一种AutoML设置,使用Python.Flask在云中训练和部署管道:以及两个可自动完成特征工程和模型构建的AutoML框架. 本文来自于搜狐网,由火龙果软件Alice编 ...
- 自动机器学习AutoML
[研究背景]随着深度神经网络的不断发展,各种模型和新颖模块的不断发明利用,人们逐渐意识到开发一种新的神经网络结构越来越费时费力,为什么不让机器自己在不断的学习过程中创造出新的神经网络呢? 正是出于这个 ...
- [机器学习]AutoML --- NNI (Microsoft)
NNI (Neurol Network Intelligence) 是微软开源的自动机器学习工具.与当前的各种自动机器学习服务或工具相比,有非常独特的价值.本文先介绍一下 NNI 的特点,然后再后续的 ...
最新文章
- BIEE物理业务层编辑之后发布路径
- python读音发音器-python3 - 文本读音器
- airpods固件更新方法_苹果AirPods 2 和 AirPods Pro固件升级
- Oracle数据库DECODE函数的使用.
- 【python项目实战入门】Python绘制爱心
- 笨办法学 Python · 续 练习 36:简单的计算器
- TimedRotatingFileHandler函数用法
- FreeTextBox使用
- 更改Edge浏览器缓存位置
- JAVA连接SQL server2000解决方法
- 宏基笔记本linux系统安装图解,宏基Aspire 4738ZG在linpus linux下安装XP系统教程
- Updating indexes
- 2021人工智能状况分析报告
- android 短信接口收拦截,闪修侠科普 | 双11垃圾短信没停过,教你一键屏蔽~
- 谈谈引用和Threadlocal的那些事
- CToolBar的使用总结1
- java卖票_Java中卖票问题
- Elasticsearch:Elastic Maps 现在支持机器学习异常层
- c语言实现补码转换成原码(原->补同理)
- 线刷MiFlash没有反映,找不到设备