features and labels calculated
This commit is contained in:
1 parent
a98aec38e0
commit
a4050f6c8d
5 files changed
+74
-16
No files matched your search
@@ -2915,9 +2915,9 @@
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "dataLabelFormula",
|
||||
"label": "Add Data Label Formula",
|
||||
"relatedUiObject": "Data Label Formula",
|
||||
"propertyToCheckFor": "labelFormula",
|
||||
"label": "Add Label Formula",
|
||||
"relatedUiObject": "Label Formula",
|
||||
"actionFunction": "payload.executeAction"
|
||||
},
|
||||
{
|
||||
@@ -2938,16 +2938,16 @@
|
||||
"propertyNameAtParent": "dataLabels",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "dataLabelFormula",
|
||||
"name": "labelFormula",
|
||||
"type": "node",
|
||||
"childType": "Data Label Formula",
|
||||
"childType": "Label Formula",
|
||||
"autoAdd": true
|
||||
}
|
||||
],
|
||||
"icon": "tensorflow"
|
||||
},
|
||||
{
|
||||
"type": "Data Label Formula",
|
||||
"type": "Label Formula",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Edit",
|
||||
@@ -2977,7 +2977,7 @@
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Data Label->"
|
||||
},
|
||||
"propertyNameAtParent": "dataLabelFormula",
|
||||
"propertyNameAtParent": "labelFormula",
|
||||
"childrenNodesProperties": [],
|
||||
"icon": "tensorflow"
|
||||
},
|
||||
|
||||
+62
-5
@@ -25,6 +25,9 @@ exports.newTensorFlowBotModulesTensorFlowLibrary = function (processIndex) {
|
||||
let tensorFlowBackend
|
||||
let tensorFlowAPI
|
||||
let tensorFlowModel
|
||||
let tensorFlowData
|
||||
let features = []
|
||||
let labels = []
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -279,6 +282,14 @@ exports.newTensorFlowBotModulesTensorFlowLibrary = function (processIndex) {
|
||||
chart = undefined
|
||||
exchange = undefined
|
||||
market = undefined
|
||||
|
||||
tensorFlowBackend = undefined
|
||||
tensorFlowAPI = undefined
|
||||
tensorFlowModel = undefined
|
||||
tensorFlowData = undefined
|
||||
|
||||
features = []
|
||||
labels = []
|
||||
}
|
||||
|
||||
function updateChart(pChart, pExchange, pMarket) {
|
||||
@@ -299,14 +310,60 @@ exports.newTensorFlowBotModulesTensorFlowLibrary = function (processIndex) {
|
||||
}
|
||||
|
||||
function run(callbackFunction) {
|
||||
/*
|
||||
Do your magic here...
|
||||
*/
|
||||
|
||||
let layersModel = learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.api.layersModel
|
||||
|
||||
/*
|
||||
if all is good, return this...
|
||||
Building the Features Tensor
|
||||
*/
|
||||
callbackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
|
||||
if (layersModel.inputLayer === undefined) {
|
||||
// TODO
|
||||
}
|
||||
if (layersModel.inputLayer.inputFeatures === undefined) {
|
||||
// TODO
|
||||
}
|
||||
learningSystem.evalFormulas(layersModel.inputLayer.inputFeatures, layersModel.inputLayer.inputFeatures.type)
|
||||
|
||||
for (let i = 0; i < layersModel.inputLayer.inputFeatures.dataFeatures.length; i++) {
|
||||
let dataFeature = layersModel.inputLayer.inputFeatures.dataFeatures[i]
|
||||
if (dataFeature.featureFormula === undefined) { continue }
|
||||
let featureValue = learningSystem.formulas.get(dataFeature.featureFormula.id)
|
||||
features.push(featureValue)
|
||||
}
|
||||
|
||||
/*
|
||||
Building the Labels Tensor
|
||||
*/
|
||||
if (layersModel.outputLayer === undefined) {
|
||||
// TODO
|
||||
}
|
||||
if (layersModel.outputLayer.outputLabels === undefined) {
|
||||
// TODO
|
||||
}
|
||||
learningSystem.evalFormulas(layersModel.outputLayer.outputLabels, layersModel.outputLayer.outputLabels.type)
|
||||
|
||||
for (let i = 0; i < layersModel.outputLayer.outputLabels.dataLabels.length; i++) {
|
||||
let dataLabel = layersModel.outputLayer.outputLabels.dataLabels[i]
|
||||
if (dataLabel.labelFormula === undefined) { continue }
|
||||
let labelValue = learningSystem.formulas.get(dataLabel.labelFormula.id)
|
||||
labels.push(labelValue)
|
||||
}
|
||||
|
||||
tensorFlowData = require("@tensorflow/tfjs-data")
|
||||
|
||||
let dataset = tensorFlowData.array([features, labels])
|
||||
|
||||
tensorFlowModel.fitDataset(dataset, { epochs: 5 }).then(info => {
|
||||
console.log('Accuracy', info.history.acc);
|
||||
|
||||
/*
|
||||
if all is good, return this...
|
||||
*/
|
||||
callbackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if something is bad, return this...
|
||||
|
||||
Reference in new issue
Block a user