Antinex Python客户端

antinex-client的Python项目详细描述


Antinex Python客户端

python api客户端,用于在restapi运行的情况下训练深层神经网络

https://github.com/jay-johnson/train-ai-with-django-swagger-jwt

https://travis-ci.org/jay-johnson/antinex-client.svg?branch=masterhttps://readthedocs.org/projects/antinex-client/badge/?version=latest

安装

pip安装antinex客户端

antinex堆栈状态

antinex客户端是antinex堆栈的一部分:

ComponentBuildDocs LinkDocs Build
REST APITravis TestsDocsRead the Docs REST API Tests
Core WorkerTravis AntiNex Core TestsDocsRead the Docs AntiNex Core Tests
Network PipelineTravis AntiNex Network Pipeline TestsDocsRead the Docs AntiNex Network Pipeline Tests
AI UtilsTravis AntiNex AI Utils TestsDocsRead the Docs AntiNex AI Utils Tests
ClientTravis AntiNex Client TestsDocsRead the Docs AntiNex Client Tests

运行预测

这些示例使用默认用户root和密码123321。建议以后将此更改为您自己的用户。

用json记录列表训练深度神经网络

ai -u root -p 123321 -f examples/predict-rows-scaler-django-simple.json

训练一个深度神经网络,用antinex数据集预测攻击

请确保rest api、芹菜工人和antinex核心工人可以使用这些数据集。数据集已经包含在Docker容器ai-core中,默认文件compose.yml中:

https://github.com/jay-johnson/train-ai-with-django-swagger-jwt/blob/51f731860daf134ea2bd3b68468927c614c83ee5/compose.yml#L53-L104

如果您在Docker外部运行,请确保使用以下命令克隆repo:

git clone https://github.com/jay-johnson/antinex-datasets.git /opt/antinex/antinex-datasets

训练django防御深层神经网络

请稍候,这需要几分钟才能返回并将预测转换为pandas数据帧。

ai -u root -p 123321 -f examples/scaler-full-django-antinex-simple.json

...

[30200 rows x 72 columns]

使用预先训练的神经网络进行预测

管理记忆中预先训练好的深层神经网络。在运行REST API compose.ymldocker容器时,可以将"publish_to_core": true添加到请求中,从而与rest api一起使用。

运行:

ai -u root -p 123321 -f examples/publish-to-core-scaler-full-django.json

下面是使用预先训练的模型运行的请求与训练新神经网络的请求之间的差异:

antinex-client$ diff examples/publish-to-core-scaler-full-django.json examples/scaler-full-django-antinex-simple.json
5d4
<     "publish_to_core": true,
antinex-client$

准备数据集

ai_prepare_dataset.py -u root -p 123321 -f examples/prepare-new-dataset.json

获取深度神经网络的工作记录

通过设置获取用户的mljob记录:-i <MLJob.id>

这包括keras dnn的模型json或模型描述。

ai_get_job.py -u root -p 123321 -i 4

获取深度神经网络的预测结果

通过设置获得用户的mljobresult记录:-i <MLJobResult.id>

这包括来自培训或预测工作的预测。

ai_get_results.py -u root -p 123321 -i 4

获取准备好的数据集

通过设置获取用户的mlprepare记录:-i <MLPrepare.id>

ai_get_prepared_dataset.py -u root -p 123321 -i 15

使用从环境变量构建的客户机

这就是Network Pipeline如何将数据流传送到AntiNex Core以使用预先训练的模型进行预测。

导出示例环境文件:

source examples/example-prediction.env

运行客户端预测流脚本

ai_env_predict.py -f examples/predict-rows-scaler-full-django.json

发展

virtualenv -p python3 ~/.venvs/antinexclient && source ~/.venvs/antinexclient/bin/activate && pip install -e .

测试

全部运行

python setup.py test

起毛

薄片8。

PycodeStyle。

许可证

apache 2.0-有关详细信息,请参阅LICENSE

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java Hibernate@ManyToMany mapping只在一个方向上在数据库中添加记录   java将文件上载到tomcat服务器外部的文件夹   java将摄像头捕获的图像上传到服务器   java如何创建Rest API并为进程添加时间延迟?   springmodulesvalidation0中缺少java注释包。8a源文件   如何在java中打印SOAP头   Spring security中的java自定义消息,包括UserDetailsService实现和异常   java如何使用Htmlunit中的表单数据登录站点   web如何在WildFly上自动运行java文件   java如何从已经使用另一个方法传递的参数的方法中获取返回值?   java我在JFrame上有一个索引越界。setContentPane   java中的循环序列/系列打印   java maven 3 webapp没有要运行的测试吗?   java CORS不允许POST请求   java再次在派生类中的Jackson中添加字段,该字段在基类中被忽略   爪哇坑测试显示仆从由于超时而异常退出   java寻找第10001个素数   java jboss是否更改web应用程序上下文根?