Links

Train Model Keras

Take the output from a DSP block and train a neural network using Keras. Updates are streamed over the websocket API.
post
https://studio.edgeimpulse.com/v1
/api/{projectId}/jobs/train/keras/{learnId}
Train model (Keras)

Take the output from a DSP block and train a neural network using Keras. Updates are streamed over the websocket API.

Parameters
Path
projectId*
integer
Project ID
learnId*
integer
Learn Block ID, use the impulse functions to retrieve the ID
Body
Example
Schema
{
"mode": "expert",
"minimumConfidenceRating": 0,
"selectedModelType": "int8",
"script": "string",
"visualLayers": [
{
"type": "dense",
"neurons": 0,
"kernelSize": 0,
"dropoutRate": 0,
"columns": 0,
"stack": 0,
"enabled": true,
"organizationModelId": 0
}
],
"trainingCycles": 0,
"learningRate": 0,
"trainTestSplit": 0,
"autoClassWeights": true,
"findLearningRate": true,
"augmentationPolicyImage": "none",
"augmentationPolicySpectrogram": {
"enabled": true,
"warping": true,
"freqMasking": "none",
"timeMasking": "none",
"gaussianNoise": "none"
},
"profileInt8": true,
"skipEmbeddingsAndMemory": true,
"customValidationMetadataKey": "string"
}
Responses
200: OK
OK
cURL
Python
Node.js
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/jobs/train/keras/{learnId} \
--header 'content-type: application/json' \
--header 'x-jwt-token: REPLACE_KEY_VALUE' \
--data '{"mode":"expert","minimumConfidenceRating":0,"selectedModelType":"int8","script":"string","visualLayers":[{"type":"dense","neurons":0,"kernelSize":0,"dropoutRate":0,"columns":0,"stack":0,"enabled":true,"organizationModelId":0}],"trainingCycles":0,"learningRate":0,"trainTestSplit":0,"autoClassWeights":true,"findLearningRate":true,"augmentationPolicyImage":"none","augmentationPolicySpectrogram":{"enabled":true,"warping":true,"freqMasking":"none","timeMasking":"none","gaussianNoise":"none"},"profileInt8":true,"skipEmbeddingsAndMemory":true,"customValidationMetadataKey":"string"}'
import http.client
conn = http.client.HTTPSConnection("studio.edgeimpulse.com")
payload = "{\"mode\":\"expert\",\"minimumConfidenceRating\":0,\"selectedModelType\":\"int8\",\"script\":\"string\",\"visualLayers\":[{\"type\":\"dense\",\"neurons\":0,\"kernelSize\":0,\"dropoutRate\":0,\"columns\":0,\"stack\":0,\"enabled\":true,\"organizationModelId\":0}],\"trainingCycles\":0,\"learningRate\":0,\"trainTestSplit\":0,\"autoClassWeights\":true,\"findLearningRate\":true,\"augmentationPolicyImage\":\"none\",\"augmentationPolicySpectrogram\":{\"enabled\":true,\"warping\":true,\"freqMasking\":\"none\",\"timeMasking\":\"none\",\"gaussianNoise\":\"none\"},\"profileInt8\":true,\"skipEmbeddingsAndMemory\":true,\"customValidationMetadataKey\":\"string\"}"
headers = {
'content-type': "application/json",
'x-jwt-token': "REPLACE_KEY_VALUE"
}
conn.request("POST", "/v1/api/{projectId}/jobs/train/keras/{learnId}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const request = require('request');
const options = {
method: 'POST',
url: 'https://studio.edgeimpulse.com/v1/api/{projectId}/jobs/train/keras/{learnId}',
headers: {'content-type': 'application/json', 'x-jwt-token': 'REPLACE_KEY_VALUE'},
body: {
mode: 'expert',
minimumConfidenceRating: 0,
selectedModelType: 'int8',
script: 'string',
visualLayers: [
{
type: 'dense',
neurons: 0,
kernelSize: 0,
dropoutRate: 0,
columns: 0,
stack: 0,
enabled: true,
organizationModelId: 0
}
],
trainingCycles: 0,
learningRate: 0,
trainTestSplit: 0,
autoClassWeights: true,
findLearningRate: true,
augmentationPolicyImage: 'none',
augmentationPolicySpectrogram: {
enabled: true,
warping: true,
freqMasking: 'none',
timeMasking: 'none',
gaussianNoise: 'none'
},
profileInt8: true,
skipEmbeddingsAndMemory: true,
customValidationMetadataKey: 'string'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});