Created
August 17, 2020 13:22
-
-
Save risenW/50cea0560db1079e4d1e639bfe0d7b09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function train() { | |
const model = get_model() | |
const data = await load_process_data() | |
const Xtrain = data[0] | |
const ytrain = data[1] | |
model.compile({ | |
optimizer: "rmsprop", | |
loss: 'binaryCrossentropy', | |
metrics: ['accuracy'], | |
}); | |
console.log("Training started....") | |
await model.fit(Xtrain, ytrain,{ | |
batchSize: 32, | |
epochs: 15, | |
validationSplit: 0.2, | |
callbacks:{ | |
onEpochEnd: async(epoch, logs)=>{ | |
console.log(`EPOCH (${epoch + 1}): Train Accuracy: ${(logs.acc * 100).toFixed(2)}, | |
Val Accuracy: ${(logs.val_acc * 100).toFixed(2)}\n`); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment