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在JavaFX TableView中设置行高   java生成范围内的随机数   ProcessBuilder或DefaultExecutor启动的“RunAs”子进程的java读取标准输出   java ExoPlayer播放多个视频   基于匹配器的java Mockito ArgumentCaptor捕获条件   java正在创建更新程序。更新/下载部分   java请求。getAttribute()在servlet中不起作用   java Android Http请求:我不理解以下代码:   java ArrayList Failfast ConcurrentModificationException   if语句Java/LWJGL Pong AI问题   使用Oracle 10g长字段填充Grails域对象时的java空指针   当用户触摸屏时,java按钮不从左上角移动到右下角   未捕获javasocket读取IOException?   用Java绘制一段圆的几何图形?