<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://studio.edgeimpulse.com/v1/api/{projectId}/training/keras/{learnId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'minimumConfidenceRating' => 123,
'script' => '<string>',
'visualLayers' => [
[
'neurons' => 123,
'kernelSize' => 123,
'dropoutRate' => 123,
'columns' => 123,
'stack' => 123,
'enabled' => true,
'organizationModelId' => 123
]
],
'trainingCycles' => 123,
'learningRate' => 123,
'batchSize' => 123,
'trainTestSplit' => 123,
'autoClassWeights' => true,
'useLearnedOptimizer' => true,
'profileInt8' => true,
'skipEmbeddingsAndMemory' => true,
'customValidationMetadataKey' => '<string>',
'showAdvancedTrainingSettings' => true,
'showAugmentationTrainingSettings' => true,
'customParameters' => [
],
'blockParameters' => [
'backbone' => '<string>',
'numLayers' => 123,
'poolSize' => 123,
'samplingRatio' => 123,
'numNearestNeighbors' => 123
],
'kFoldsValidationConfig' => [
'numFolds' => 123,
'includeFinalTrainingRun' => true,
'extraEpochs' => 123
],
'assertGpuUsagePercentage' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}