Contents

execute(inputsData:lossLabelsData:lossLabelWeightsData:outputsData:batchSize:options:completionHandler:)

Executes the training graph with the input data, output data, batch size, execution options, and completion handler that you specify.

Declaration

func execute(inputsData: [String : MLCTensorData], lossLabelsData: [String : MLCTensorData]?, lossLabelWeightsData: [String : MLCTensorData]?, outputsData: [String : MLCTensorData]?, batchSize: Int, options: MLCExecutionOptions = [], completionHandler: MLCGraphCompletionHandler? = nil) -> Bool

Parameters

  • inputsData:

    A dictionary that contains input data.

  • lossLabelsData:

    A dictionary that contains loss labels data.

  • lossLabelWeightsData:

    A dictionary that contains loss label weights data.

  • outputsData:

    A dictionary that contains output data.

  • batchSize:

    The batch size.

  • options:

    The execution options.

  • completionHandler:

    The completion handler.

Return Value

true if the execution was successful.

Discussion

When you execute a training iteration, if you specified an optimizer when you created the graph, the framework applies the optimizer update.

For variable length sequences for LSTMs/RNNs, use the key “sortedSequenceLength” and pass in tensor data created by using one of the MLCTensor sequence length initializers as the value.

If you include synchronous in options, the execution method only returns after the graph has finished execution. Otherwise, the execution method returns once the framework enqueues the graph for execution. However, the completion handler is still not called until after the graph has finished execution.

See Also

Executing Training Iterations