Skip to content

Commit

Permalink
demo: Bump versions and other minor clarifications. (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
juharris authored Jul 31, 2019
1 parent ae5b446 commit e2ebaa3
Show file tree
Hide file tree
Showing 9 changed files with 907 additions and 81 deletions.
2 changes: 1 addition & 1 deletion demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:10.15

LABEL maintainer="Justin Harris (justin.harris@microsoft.com)"
LABEL maintainer="Justin D. Harris (justin.harris@microsoft.com)"
LABEL org.label-schema.vendor="Microsoft"
LABEL org.label-schema.url="https://github.com/microsoft/0xDeCA10B/tree/master/demo"
LABEL org.label-schema.vcs-url="https://github.com/microsoft/0xDeCA10B/tree/master/demo"
Expand Down
2 changes: 1 addition & 1 deletion demo/client/contracts/classification/Perceptron.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ contract Perceptron is Classifier64 {
}

function update(int64[] memory data, uint64 classification) public onlyOwner {
// Data is binarized (data holds the indices of the features that are present).
uint64 prediction = predict(data);
if (prediction != classification) {
// Update model.
// predict checks each data[i] >= 0.
uint i;
uint len = data.length;
// Data is binarized.
int80 change = toFloat * learningRate;
if (classification > 0) {
// sign = 1
Expand Down
6 changes: 4 additions & 2 deletions demo/client/contracts/data/DataHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ contract DataHandler64 is Ownable, DataHandler {
* The amount of the deposit that can still be claimed.
*/
uint claimableAmount;

mapping (address => bool) claimedBy;
/**
* The set of addresses that claimed a refund or reward on this data.
*/
mapping(address => bool) claimedBy;
}

mapping(bytes32 => StoredData) public addedData;
Expand Down
2 changes: 1 addition & 1 deletion demo/client/migrations/2_deploy_sentiment_classifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = async function (deployer) {
for (let i = initNumWords; i < weights.length; i += numWordsPerUpdate) {
await classifier.initializeWeights(i, weights.slice(i, i + numWordsPerUpdate),
{ gas: 7.9E6 });
console.log(` Added weights ${i + numWordsPerUpdate}`);
console.log(` Added ${i + numWordsPerUpdate} weights.`);
}

console.log(`Deploying collaborative trainer contract.`);
Expand Down
4 changes: 2 additions & 2 deletions demo/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"react-scripts": "^2.1.8",
"truffle": "^5.0.22",
"web3": "^1.0.0-beta.52"
"truffle": "^5.0.29",
"web3": "^1.2.0"
},
"scripts": {
"start": "bash deploy_client.sh",
Expand Down
1 change: 0 additions & 1 deletion demo/client/test/contracts/vpa-classifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ contract('VpaClassifier', function (accounts) {

const originalDataCount = await classifier.dataCounts(classification).then(parseBN);

console.log(" Adding data.");
const r = await instance.addData(normalizedData, classification, { from: accounts[0], value: cost });
assert.isBelow(r.receipt.gasUsed, 7.9E6, "Too much gas used.");
assert.isBelow(r.receipt.cumulativeGasUsed, 7.9E6, "Too much gas used.");
Expand Down
Loading

0 comments on commit e2ebaa3

Please sign in to comment.