Model Compiling for the first time

This commit is contained in:
Luis Fernando Molina committed 2021-02-17 16:18:28 +01:00
1 parent 6aa2ebd8fe
commit d0fb099c33
3 files changed
+180

No files matched your search

+144
View File
@@ -351,6 +351,30 @@
"relatedUiObject": "Core API",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "optimizer",
"label": "Add Optimizer",
"relatedUiObject": "Optimizer",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "lossFunction",
"label": "Add Loss Function",
"relatedUiObject": "Loss Function",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "metrics",
"label": "Add Metrics",
"relatedUiObject": "Metrics",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
@@ -383,10 +407,130 @@
"name": "api",
"type": "node",
"childType": "Core API"
},
{
"name": "optimizer",
"type": "node",
"childType": "Optimizer"
},
{
"name": "lossFunction",
"type": "node",
"childType": "Loss Function"
},
{
"name": "metrics",
"type": "node",
"childType": "Metrics"
}
],
"icon": "tensorflow"
},
{
"type": "Optimizer",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n \"value\": \"sgd\"\n}"
},
"addLeftIcons": true,
"level": 3,
"attachingRules": {
"compatibleTypes": "->Model->"
},
"propertyNameAtParent": "optimizer",
"childrenNodesProperties": [],
"icon": "tensorflow"
},
{
"type": "Loss Function",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n \"value\": \"categoricalCrossentropy\"\n}"
},
"addLeftIcons": true,
"level": 3,
"attachingRules": {
"compatibleTypes": "->Model->"
},
"propertyNameAtParent": "lossFunction",
"childrenNodesProperties": [],
"icon": "tensorflow"
},
{
"type": "Metrics",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n \"value\": [\"accuracy\"]\n}"
},
"addLeftIcons": true,
"level": 3,
"attachingRules": {
"compatibleTypes": "->Model->"
},
"propertyNameAtParent": "metrics",
"childrenNodesProperties": [],
"icon": "tensorflow"
},
{
"type": "Layers API",
"menuItems": [
@@ -37,6 +37,7 @@ exports.newTensorFlowBotModulesTensorFlowLibrary = function (processIndex) {
setupBackend()
setupEnvironmentFlags()
setupModel()
compileModel()
callbackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
@@ -235,6 +236,40 @@ exports.newTensorFlowBotModulesTensorFlowLibrary = function (processIndex) {
}
}
}
function compileModel() {
if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.optimizer === undefined) {
//TODO
return
}
if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.optimizer.config.value === undefined) {
//TODO
return
}
if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.lossFunction === undefined) {
//TODO
return
}
if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.lossFunction.config.value === undefined) {
//TODO
return
}
if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.metrics === undefined) {
//TODO
return
}
if (learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.metrics.config.value === undefined) {
//TODO
return
}
let compileArgs = {
optimizer: learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.optimizer.config.value,
loss: learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.lossFunction.config.value,
metrics: [learningSystem.machineLearningLibrary.typeOfLearning.typeOfModel.model.metrics.config.value]
}
tensorFlowModel.compile(compileArgs)
}
}
function finalize() {