Giter VIP home page Giter VIP logo

blocktrain's Introduction

BlockTrain

简介

这是一个将人工智能模型的训练和区块链结合的社区

想法来源
1. 现在某些人工智能模型的训练需要消耗大量的算力资源,有的时候使用一台机器可能需要花费大量的时间,所以现在出现了分布式训练的方法(在tensorflow中就内置有分布式训练的方法)
2. 同时对于某些区块链系统(比特币、以太坊)来说,使用了POW算法,这种算法同样消耗了大量的算力。
3. 这样不经令人想到能否将这两个东西结合起来,能否使用区块链系统的算力来对人工智能的模型进行训练,同时训练所产生的费用信息将被记录到区块链上,这样增强了系统的可靠性

预想的框架

预想的框架采用B/S模式。是在以太坊区块链系统中加入一个模型训练的模块,然后采用智能合约对模型训练产生的费用进行管理。

现阶段完成的内容

模型训练模块已基本完成,模型训练模块使用的是go语言,节点之间的访问使用的是http协议
和区块链的连接还在进行中...

环境搭建和运行

此应用的运行首先要具备go、python3以及python的tensorflow库的环境
由于还没有解决windows下运行的问题,所以这里只提供Ubuntu和CentOS两种系统的环境安装脚本
分别是setup_ubuntu.sh和setup_centos.sh
运行方法
首先,确保自己是在root用户下执行,若不是,请在命令之前加上sudo
# Ubuntu下的安装
bash setup_ubuntu.sh
# CentOS下的安装
bash setup_centos.sh

# P.S. 在安装的过程中会有两个需要输入(确认的地方),第一个是询问是否使用镜像加速,第二个是填写GOPATH(默认是/code/go)
环境全部搭建完后,就可以运行这个分布式的模型训练系统
这里也给出了一个脚本进行一键编译运行
使用方法:
# 一键编译运行
bash run.sh
当然你也可以自己进行编译和运行:
# 首先进行安装
go install run.go
# 然后进行编译
go build run.go
# 这是会产生一个可执行程序,直接运行即可
./run

模型训练方法

P.S. 现在还没有对用户身份进行管理
首先由一个用户开启自己的模型训练

http://<your-ip>:12345/prepareTraining
然后由其他的用户加入这个模型训练
注意,加入模型训练后就不能退出,如果退出,将导致这个模型训练失败

http://<your-ip>:12345/addIP
当开启模型训练的用户认为节点数量足够时,就可以开始训练

http://<your-ip>:12345/startTraining
一般模型训练会自动结束(如果训练不能正常结束,可能需要停止进程)
当模型训练结束时
开启模型训练的用户可以关闭这个模型训练的窗口

http://<your-ip>:12345/stopTraining

需要注意的事项

现在的系统还有很多的缺陷,所以有些地方需要注意

  1. 加入模型训练的用户必须一直进行训练,不能退出,不然会导致训练的失败
  2. 现在不存在用户管理,所以所有用户都可以对对方的系统进行操作
  3. 现在不能对任意的模型进行训练,这里采用的模型是来自于distributeTensorflowExample

blocktrain's People

Contributors

h1sk1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.