Example #1
0
        IEnumerator PollNetwork()
        {
            var request = new Request();

            yield return(request.GetBlockNumber(this));

            yield return(request.GetModel(this));

            var ipfsAddress = request.modelResponse.configAddress;
            var owner       = request.modelResponse.owner;

            Debug.Log("IPFS address: " + ipfsAddress);
            Debug.Log("owner: " + owner);

            IpfsExperiment model = Ipfs.Get <IpfsExperiment>(ipfsAddress);

            if (model != null)
            {
                // Debug.Log("Got the IpfsModel: " + model.input);

                // TODO do some training!!!
                //var g = new Controllers.Grid(controller);
                //g.TrainModel(model, numModels - 1);
            }

            Debug.Log("Blockchain polled");

            // TODO should probably only poll again once above training is done
            yield return(new WaitForSeconds(10));

            PollNext();
        }
Example #2
0
        IEnumerator PollNetwork()
        {
            var request = new Request();

            yield return(request.GetBlockNumber(this));

            yield return(request.GetModel(this));

            var ipfsAddress = request.modelResponse.configAddress;

            Debug.Log("IPFS address: " + ipfsAddress);

            IpfsModel model = Ipfs.GetModel(ipfsAddress);

            if (model != null)
            {
                Debug.Log("Got the IpfsModel: " + model.input);

                //var g = new Controllers.Grid(controller);
                //g.TrainModel(model);
            }

            Debug.Log("Blockchain polled");

            yield return(new WaitForSeconds(10));

            PollNext();
        }
Example #3
0
        private void Start()
        {
            _netMqPublisher = new NetMqPublisher(HandleMessage);
            _netMqPublisher.Start();

            controller = new SyftController(shader);

            var experiment = Ipfs.Get <IpfsExperiment>("QmVPQnsuks1cCbTMFGqpmHa4M45uUuKRomiqNvJEQAtcRS");
            var job        = Ipfs.Get <IpfsJob>(experiment.jobs[0]);

            var g = new OpenMined.Network.Controllers.Grid(controller);
            //g.TrainModel(this, experiment.input, experiment.target, job, 1);
        }