slash.network.createDeep(3, [3,3,3], 2).then(id => {
return slash.await(id);
}).then(result => {
const networkId = result.objectId;
return slash.network.getInstance(networkId);
}).then(network => {
network.train([
{ input: [0.1, 0.2, 0.3], output: [0.5, 0.6]},
{ input: [0.5, 0.6, 0.7], output: [0.2, 0.1]}
]).then(id => {
return slash.await(id);
}).then(result => {
if(result.status !== "done"){
return console.log("training failed: " + result.error);
}
console.log("training completed: " + JSON.stringify(result.result));
});
Promise.all([
network.stack([{ input: [], output: []}]),
network.stack([..]),
network.stack([..]),
network.stack([..])
]).then(r => {
network.runStack().then(id => {
return slash.await(id);
}).then(result => {
console.log("training of stack completed. " + JSON.stringify(result.result));
});
});
network.process([0.2, 0.4, 0.5]).then(result => {
console.log("process result: " + result.output);
});
network.info().then(info => console.log(info));
network.remove().then(id => {
return slash.await(id);
}).then(result => {
if(result.status === "done"){
console.log("network " + network.id + " has been deleted.");
}
});
});