Keras settings

Keras settings

post

Configure the Keras block, such as its minimum confidence score. Use the impulse blocks to find the learnId.

Authorizations
Path parameters
projectIdintegerrequired

Project ID

learnIdintegerrequired

Learn Block ID, use the impulse functions to retrieve the ID

Body
modestring · enumoptional

Whether to use visual or expert mode.

Options: expert, visual
minimumConfidenceRatingnumberoptional

Minimum confidence score, if the neural network scores a sample below this threshold it will be flagged as uncertain.

selectedModelTypestring · enumoptional

The model type to select, as described in the model metadata call.

Options: int8, float32, akida, requiresRetrain
scriptstringoptional

Raw Keras script (only used in expert mode)

visualLayersobject[]optional

The visual layers for the neural network (only in visual mode).

trainingCyclesintegeroptional

Number of training cycles (only in visual mode).

learningRatenumberoptional

Learning rate (between 0 and 1) (only in visual mode).

batchSizenumberoptional

Batch size used during training (only in visual mode).

trainTestSplitnumberoptional

Train/test split (between 0 and 1)

autoClassWeightsbooleanoptional

Whether to automatically balance class weights, use this for skewed datasets.

useLearnedOptimizerbooleanoptional

Use learned optimizer and ignore learning rate.

augmentationPolicyImagestring · enumoptional

The data augmentation policy to use with image input

Options: none, all
augmentationPolicySpectrogramobjectoptional

profileInt8booleanoptional

Whether to profile the i8 model (might take a very long time)

skipEmbeddingsAndMemorybooleanoptional

If set, skips creating embeddings and measuring memory (used in tests)

akidaEdgeLearningConfigobjectoptional

customValidationMetadataKeystringoptional

If the 'custom validation split' experiment is enabled, this metadata key is used to prevent group data leakage between train and validation datasets.

showAdvancedTrainingSettingsbooleanoptional

Whether the 'Advanced training settings' UI element should be expanded.

showAugmentationTrainingSettingsbooleanoptional

Whether the 'Augmentation training settings' UI element should be expanded.

customParametersobjectoptional

Training parameters, this list depends on the list of parameters that the model exposes.

anomalyCapacitystring · enumoptional

Capacity level for visual anomaly detection. Determines which set of default configurations to use. The higher capacity, the higher number of (Gaussian) components, and the more adapted the model becomes to the original distribution

Options: low, medium, high
lastShownModelVariantstring · enumoptional

Last shown variant on the Keras screen. Used to keep the same view after refreshing.

Options: int8, float32, akida
blockParametersone ofoptional

Training parameters specific to the type of the learn block. Parameters may be adjusted depending on the model defined in the visual layers. Used for our built-in blocks.

Responses
curl -L \
  --request POST \
  --url 'https://studio.edgeimpulse.com/v1/api/{projectId}/training/keras/{learnId}' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "mode": "expert",
    "minimumConfidenceRating": 1,
    "selectedModelType": "int8",
    "script": "text",
    "visualLayers": [
      {
        "type": "dense",
        "neurons": 1,
        "kernelSize": 1,
        "dropoutRate": 1,
        "columns": 1,
        "stack": 1,
        "enabled": true,
        "organizationModelId": 1
      }
    ],
    "trainingCycles": 1,
    "learningRate": 1,
    "batchSize": 1,
    "trainTestSplit": 1,
    "autoClassWeights": true,
    "useLearnedOptimizer": true,
    "augmentationPolicyImage": "none",
    "augmentationPolicySpectrogram": {
      "enabled": true,
      "warping": true,
      "freqMasking": "none",
      "timeMasking": "none",
      "gaussianNoise": "none"
    },
    "profileInt8": true,
    "skipEmbeddingsAndMemory": true,
    "akidaEdgeLearningConfig": {
      "enabled": true,
      "additionalClasses": 1,
      "neuronsPerClass": 1
    },
    "customValidationMetadataKey": "text",
    "showAdvancedTrainingSettings": true,
    "showAugmentationTrainingSettings": true,
    "customParameters": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "anomalyCapacity": "low",
    "lastShownModelVariant": "int8",
    "blockParameters": {
      "backbone": "text",
      "numLayers": 1,
      "poolSize": 1,
      "samplingRatio": 1,
      "numNearestNeighbors": 1
    }
  }'
{
  "success": true,
  "error": "text"
}

Last updated

Was this helpful?