Documentation
¶
Overview ¶
Package mlcompute provides purego-based Go bindings for the macOS MLCompute framework.
Apple documentation: https://developer.apple.com/documentation/mlcompute
Index ¶
- func MLCActivationTypeDebugDescription(activationType MLCActivationType) *foundation.NSString
- func MLCArithmeticOperationDebugDescription(operation MLCArithmeticOperation) *foundation.NSString
- func MLCComparisonOperationDebugDescription(operation MLCComparisonOperation) *foundation.NSString
- func MLCConvolutionTypeDebugDescription(convolutionType MLCConvolutionType) *foundation.NSString
- func MLCGradientClippingTypeDebugDescription(gradientClippingType MLCGradientClippingType) *foundation.NSString
- func MLCLSTMResultModeDebugDescription(mode MLCLSTMResultMode) *foundation.NSString
- func MLCLayerSupportsDataTypeOnDevice(dataType MLCDataType, device *MLCDevice) bool
- func MLCLossTypeDebugDescription(lossType MLCLossType) *foundation.NSString
- func MLCPaddingPolicyDebugDescription(paddingPolicy MLCPaddingPolicy) *foundation.NSString
- func MLCPaddingTypeDebugDescription(paddingType MLCPaddingType) *foundation.NSString
- func MLCPlatformGetRNGseed() *foundation.NSNumber
- func MLCPlatformSetRNGSeedTo(seed *foundation.NSNumber)
- func MLCPoolingTypeDebugDescription(poolingType MLCPoolingType) *foundation.NSString
- func MLCReductionTypeDebugDescription(reductionType MLCReductionType) *foundation.NSString
- func MLCSampleModeDebugDescription(mode MLCSampleMode) *foundation.NSString
- func MLCSoftmaxOperationDebugDescription(operation MLCSoftmaxOperation) *foundation.NSString
- func MLCTensorDescriptorMaxTensorDimensions() uint
- func SymbolAvailable(symbol string) bool
- type Acl_entry_id_t
- type Acl_flag_t
- type Acl_perm_t
- type Acl_tag_t
- type Acl_type_t
- type Clockid_t
- type Dispatch_autorelease_frequency_t
- type Dispatch_block_flags_t
- type Filesec_property_t
- type Idtype_t
- type Ipc_info_object_type_t
- type Launch_data_type_t
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type MLCActivationDescriptor
- func MLCActivationDescriptorDescriptorWithType(activationType MLCActivationType) *MLCActivationDescriptor
- func MLCActivationDescriptorDescriptorWithTypeA(activationType MLCActivationType, a float32) *MLCActivationDescriptor
- func MLCActivationDescriptorDescriptorWithTypeAB(activationType MLCActivationType, a float32, b float32) *MLCActivationDescriptor
- func MLCActivationDescriptorDescriptorWithTypeABC(activationType MLCActivationType, a float32, b float32, c float32) *MLCActivationDescriptor
- func MLCActivationDescriptorFromID(id objc.ID) *MLCActivationDescriptor
- type MLCActivationLayer
- func MLCActivationLayerAbsoluteLayer() *MLCActivationLayer
- func MLCActivationLayerCeluLayer() *MLCActivationLayer
- func MLCActivationLayerCeluLayerWithA(a float32) *MLCActivationLayer
- func MLCActivationLayerClampLayerWithMinValueMaxValue(minValue float32, maxValue float32) *MLCActivationLayer
- func MLCActivationLayerEluLayer() *MLCActivationLayer
- func MLCActivationLayerEluLayerWithA(a float32) *MLCActivationLayer
- func MLCActivationLayerFromID(id objc.ID) *MLCActivationLayer
- func MLCActivationLayerGeluLayer() *MLCActivationLayer
- func MLCActivationLayerHardShrinkLayer() *MLCActivationLayer
- func MLCActivationLayerHardShrinkLayerWithA(a float32) *MLCActivationLayer
- func MLCActivationLayerHardSigmoidLayer() *MLCActivationLayer
- func MLCActivationLayerHardSwishLayer() *MLCActivationLayer
- func MLCActivationLayerLayerWithDescriptor(descriptor *MLCActivationDescriptor) *MLCActivationLayer
- func MLCActivationLayerLeakyReLULayer() *MLCActivationLayer
- func MLCActivationLayerLeakyReLULayerWithNegativeSlope(negativeSlope float32) *MLCActivationLayer
- func MLCActivationLayerLinearLayerWithScaleBias(scale float32, bias float32) *MLCActivationLayer
- func MLCActivationLayerLogSigmoidLayer() *MLCActivationLayer
- func MLCActivationLayerRelu6Layer() *MLCActivationLayer
- func MLCActivationLayerReluLayer() *MLCActivationLayer
- func MLCActivationLayerRelunLayerWithAB(a float32, b float32) *MLCActivationLayer
- func MLCActivationLayerSeluLayer() *MLCActivationLayer
- func MLCActivationLayerSigmoidLayer() *MLCActivationLayer
- func MLCActivationLayerSoftPlusLayer() *MLCActivationLayer
- func MLCActivationLayerSoftPlusLayerWithBeta(beta float32) *MLCActivationLayer
- func MLCActivationLayerSoftShrinkLayer() *MLCActivationLayer
- func MLCActivationLayerSoftShrinkLayerWithA(a float32) *MLCActivationLayer
- func MLCActivationLayerSoftSignLayer() *MLCActivationLayer
- func MLCActivationLayerTanhLayer() *MLCActivationLayer
- func MLCActivationLayerTanhShrinkLayer() *MLCActivationLayer
- func MLCActivationLayerThresholdLayerWithThresholdReplacement(threshold float32, replacement float32) *MLCActivationLayer
- type MLCActivationType
- type MLCAdamOptimizer
- func MLCAdamOptimizerFromID(id objc.ID) *MLCAdamOptimizer
- func MLCAdamOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCAdamOptimizer
- func MLCAdamOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonTimeStep(optimizerDescriptor *MLCOptimizerDescriptor, beta1 float32, beta2 float32, ...) *MLCAdamOptimizer
- func MLCAdamOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *MLCOptimizerDescriptor, beta1 float32, beta2 float32, ...) *MLCAdamOptimizer
- type MLCAdamWOptimizer
- func MLCAdamWOptimizerFromID(id objc.ID) *MLCAdamWOptimizer
- func MLCAdamWOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCAdamWOptimizer
- func MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *MLCOptimizerDescriptor, beta1 float32, beta2 float32, ...) *MLCAdamWOptimizer
- type MLCArithmeticLayer
- type MLCArithmeticOperation
- type MLCBatchNormalizationLayer
- func MLCBatchNormalizationLayerFromID(id objc.ID) *MLCBatchNormalizationLayer
- func MLCBatchNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon(featureChannelCount uint, mean *MLCTensor, variance *MLCTensor, ...) *MLCBatchNormalizationLayer
- func MLCBatchNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount uint, mean *MLCTensor, variance *MLCTensor, ...) *MLCBatchNormalizationLayer
- func (o *MLCBatchNormalizationLayer) Beta() *MLCTensor
- func (o *MLCBatchNormalizationLayer) BetaParameter() *MLCTensorParameter
- func (o *MLCBatchNormalizationLayer) FeatureChannelCount() uint
- func (o *MLCBatchNormalizationLayer) Gamma() *MLCTensor
- func (o *MLCBatchNormalizationLayer) GammaParameter() *MLCTensorParameter
- func (o *MLCBatchNormalizationLayer) Mean() *MLCTensor
- func (o *MLCBatchNormalizationLayer) Momentum() float32
- func (o *MLCBatchNormalizationLayer) Variance() *MLCTensor
- func (o *MLCBatchNormalizationLayer) VarianceEpsilon() float32
- type MLCComparisonLayer
- type MLCComparisonOperation
- type MLCConcatenationLayer
- type MLCConvolutionDescriptor
- func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth uint, kernelHeight uint, inputFeatureChannelCount uint, ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier(kernelWidth uint, kernelHeight uint, inputFeatureChannelCount uint, ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth uint, kernelHeight uint, inputFeatureChannelCount uint, ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorDescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(convolutionType MLCConvolutionType, ...) *MLCConvolutionDescriptor
- func MLCConvolutionDescriptorFromID(id objc.ID) *MLCConvolutionDescriptor
- func (o *MLCConvolutionDescriptor) ConvolutionType() MLCConvolutionType
- func (o *MLCConvolutionDescriptor) DilationRateInX() uint
- func (o *MLCConvolutionDescriptor) DilationRateInY() uint
- func (o *MLCConvolutionDescriptor) GroupCount() uint
- func (o *MLCConvolutionDescriptor) InputFeatureChannelCount() uint
- func (o *MLCConvolutionDescriptor) IsConvolutionTranspose() bool
- func (o *MLCConvolutionDescriptor) KernelHeight() uint
- func (o *MLCConvolutionDescriptor) KernelWidth() uint
- func (o *MLCConvolutionDescriptor) OutputFeatureChannelCount() uint
- func (o *MLCConvolutionDescriptor) PaddingPolicy() MLCPaddingPolicy
- func (o *MLCConvolutionDescriptor) PaddingSizeInX() uint
- func (o *MLCConvolutionDescriptor) PaddingSizeInY() uint
- func (o *MLCConvolutionDescriptor) StrideInX() uint
- func (o *MLCConvolutionDescriptor) StrideInY() uint
- func (o *MLCConvolutionDescriptor) UsesDepthwiseConvolution() bool
- type MLCConvolutionLayer
- func (o *MLCConvolutionLayer) Biases() *MLCTensor
- func (o *MLCConvolutionLayer) BiasesParameter() *MLCTensorParameter
- func (o *MLCConvolutionLayer) Descriptor() *MLCConvolutionDescriptor
- func (o *MLCConvolutionLayer) Weights() *MLCTensor
- func (o *MLCConvolutionLayer) WeightsParameter() *MLCTensorParameter
- type MLCConvolutionType
- type MLCDataType
- type MLCDevice
- func MLCDeviceAneDevice() *MLCDevice
- func MLCDeviceCpuDevice() *MLCDevice
- func MLCDeviceDeviceWithGPUDevices(gpus *foundation.NSArray[metal.MTLDevice]) *MLCDevice
- func MLCDeviceDeviceWithType(type_ MLCDeviceType) *MLCDevice
- func MLCDeviceDeviceWithTypeSelectsMultipleComputeDevices(type_ MLCDeviceType, selectsMultipleComputeDevices bool) *MLCDevice
- func MLCDeviceFromID(id objc.ID) *MLCDevice
- func MLCDeviceGpuDevice() *MLCDevice
- type MLCDeviceType
- type MLCDropoutLayer
- type MLCEmbeddingDescriptor
- func MLCEmbeddingDescriptorDescriptorWithEmbeddingCountEmbeddingDimension(embeddingCount *foundation.NSNumber, embeddingDimension *foundation.NSNumber) *MLCEmbeddingDescriptor
- func MLCEmbeddingDescriptorDescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency(embeddingCount *foundation.NSNumber, embeddingDimension *foundation.NSNumber, ...) *MLCEmbeddingDescriptor
- func MLCEmbeddingDescriptorFromID(id objc.ID) *MLCEmbeddingDescriptor
- func (o *MLCEmbeddingDescriptor) EmbeddingCount() *foundation.NSNumber
- func (o *MLCEmbeddingDescriptor) EmbeddingDimension() *foundation.NSNumber
- func (o *MLCEmbeddingDescriptor) MaximumNorm() *foundation.NSNumber
- func (o *MLCEmbeddingDescriptor) PNorm() *foundation.NSNumber
- func (o *MLCEmbeddingDescriptor) PaddingIndex() *foundation.NSNumber
- func (o *MLCEmbeddingDescriptor) ScalesGradientByFrequency() bool
- type MLCEmbeddingLayer
- type MLCExecutionOptions
- type MLCFullyConnectedLayer
- func (o *MLCFullyConnectedLayer) Biases() *MLCTensor
- func (o *MLCFullyConnectedLayer) BiasesParameter() *MLCTensorParameter
- func (o *MLCFullyConnectedLayer) Descriptor() *MLCConvolutionDescriptor
- func (o *MLCFullyConnectedLayer) Weights() *MLCTensor
- func (o *MLCFullyConnectedLayer) WeightsParameter() *MLCTensorParameter
- type MLCGatherLayer
- type MLCGradientClippingType
- type MLCGramMatrixLayer
- type MLCGraph
- func (o *MLCGraph) BindAndWriteDataForInputsToDeviceBatchSizeSynchronous(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCGraph) BindAndWriteDataForInputsToDeviceSynchronous(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCGraph) ConcatenateWithSourcesDimension(sources *foundation.NSArray[*MLCTensor], dimension uint) *MLCTensor
- func (o *MLCGraph) Device() *MLCDevice
- func (o *MLCGraph) GatherWithDimensionSourceIndices(dimension uint, source *MLCTensor, indices *MLCTensor) *MLCTensor
- func (o *MLCGraph) Layers() *foundation.NSArray[*MLCLayer]
- func (o *MLCGraph) NodeWithLayerSource(layer *MLCLayer, source *MLCTensor) *MLCTensor
- func (o *MLCGraph) NodeWithLayerSources(layer *MLCLayer, sources *foundation.NSArray[*MLCTensor]) *MLCTensor
- func (o *MLCGraph) NodeWithLayerSourcesDisableUpdate(layer *MLCLayer, sources *foundation.NSArray[*MLCTensor], disableUpdate bool) *MLCTensor
- func (o *MLCGraph) NodeWithLayerSourcesLossLabels(layer *MLCLayer, sources *foundation.NSArray[*MLCTensor], ...) *MLCTensor
- func (o *MLCGraph) ReshapeWithShapeSource(shape *foundation.NSArray[*foundation.NSNumber], source *MLCTensor) *MLCTensor
- func (o *MLCGraph) ResultTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
- func (o *MLCGraph) ScatterWithDimensionSourceIndicesCopyFromReductionType(dimension uint, source *MLCTensor, indices *MLCTensor, copyFrom *MLCTensor, ...) *MLCTensor
- func (o *MLCGraph) SelectWithSourcesCondition(sources *foundation.NSArray[*MLCTensor], condition *MLCTensor) *MLCTensor
- func (o *MLCGraph) SourceTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
- func (o *MLCGraph) SplitWithSourceSplitCountDimension(source *MLCTensor, splitCount uint, dimension uint) *foundation.NSArray[*MLCTensor]
- func (o *MLCGraph) SplitWithSourceSplitSectionLengthsDimension(source *MLCTensor, ...) *foundation.NSArray[*MLCTensor]
- func (o *MLCGraph) SummarizedDOTDescription() *foundation.NSString
- func (o *MLCGraph) TransposeWithDimensionsSource(dimensions *foundation.NSArray[*foundation.NSNumber], source *MLCTensor) *MLCTensor
- type MLCGraphCompilationOptions
- type MLCGroupNormalizationLayer
- func (o *MLCGroupNormalizationLayer) Beta() *MLCTensor
- func (o *MLCGroupNormalizationLayer) BetaParameter() *MLCTensorParameter
- func (o *MLCGroupNormalizationLayer) FeatureChannelCount() uint
- func (o *MLCGroupNormalizationLayer) Gamma() *MLCTensor
- func (o *MLCGroupNormalizationLayer) GammaParameter() *MLCTensorParameter
- func (o *MLCGroupNormalizationLayer) GroupCount() uint
- func (o *MLCGroupNormalizationLayer) VarianceEpsilon() float32
- type MLCInferenceGraph
- func (o *MLCInferenceGraph) AddInputs(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
- func (o *MLCInferenceGraph) AddInputsLossLabelsLossLabelWeights(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor], ...) bool
- func (o *MLCInferenceGraph) AddOutputs(outputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
- func (o *MLCInferenceGraph) CompileWithOptionsDevice(options MLCGraphCompilationOptions, device *MLCDevice) bool
- func (o *MLCInferenceGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options MLCGraphCompilationOptions, device *MLCDevice, ...) bool
- func (o *MLCInferenceGraph) DeviceMemorySize() uint
- func (o *MLCInferenceGraph) ExecuteWithInputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCInferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCInferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCInferenceGraph) ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCInferenceGraph) LinkWithGraphs(graphs *foundation.NSArray[*MLCInferenceGraph]) bool
- type MLCInstanceNormalizationLayer
- func MLCInstanceNormalizationLayerFromID(id objc.ID) *MLCInstanceNormalizationLayer
- func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountBetaGammaVarianceEpsilon(featureChannelCount uint, beta *MLCTensor, gamma *MLCTensor, ...) *MLCInstanceNormalizationLayer
- func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum(featureChannelCount uint, beta *MLCTensor, gamma *MLCTensor, ...) *MLCInstanceNormalizationLayer
- func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount uint, mean *MLCTensor, variance *MLCTensor, ...) *MLCInstanceNormalizationLayer
- func (o *MLCInstanceNormalizationLayer) Beta() *MLCTensor
- func (o *MLCInstanceNormalizationLayer) BetaParameter() *MLCTensorParameter
- func (o *MLCInstanceNormalizationLayer) FeatureChannelCount() uint
- func (o *MLCInstanceNormalizationLayer) Gamma() *MLCTensor
- func (o *MLCInstanceNormalizationLayer) GammaParameter() *MLCTensorParameter
- func (o *MLCInstanceNormalizationLayer) Mean() *MLCTensor
- func (o *MLCInstanceNormalizationLayer) Momentum() float32
- func (o *MLCInstanceNormalizationLayer) Variance() *MLCTensor
- func (o *MLCInstanceNormalizationLayer) VarianceEpsilon() float32
- type MLCLSTMDescriptor
- func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCount(inputSize uint, hiddenSize uint, layerCount uint) *MLCLSTMDescriptor
- func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, ...) *MLCLSTMDescriptor
- func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, ...) *MLCLSTMDescriptor
- func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, ...) *MLCLSTMDescriptor
- func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, ...) *MLCLSTMDescriptor
- func MLCLSTMDescriptorFromID(id objc.ID) *MLCLSTMDescriptor
- func (o *MLCLSTMDescriptor) BatchFirst() bool
- func (o *MLCLSTMDescriptor) Dropout() float32
- func (o *MLCLSTMDescriptor) HiddenSize() uint
- func (o *MLCLSTMDescriptor) InputSize() uint
- func (o *MLCLSTMDescriptor) IsBidirectional() bool
- func (o *MLCLSTMDescriptor) LayerCount() uint
- func (o *MLCLSTMDescriptor) ResultMode() MLCLSTMResultMode
- func (o *MLCLSTMDescriptor) ReturnsSequences() bool
- func (o *MLCLSTMDescriptor) UsesBiases() bool
- type MLCLSTMLayer
- func MLCLSTMLayerFromID(id objc.ID) *MLCLSTMLayer
- func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsBiases(descriptor *MLCLSTMDescriptor, inputWeights *foundation.NSArray[*MLCTensor], ...) *MLCLSTMLayer
- func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases(descriptor *MLCLSTMDescriptor, inputWeights *foundation.NSArray[*MLCTensor], ...) *MLCLSTMLayer
- func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation(descriptor *MLCLSTMDescriptor, inputWeights *foundation.NSArray[*MLCTensor], ...) *MLCLSTMLayer
- func (o *MLCLSTMLayer) Biases() *foundation.NSArray[*MLCTensor]
- func (o *MLCLSTMLayer) BiasesParameters() *foundation.NSArray[*MLCTensorParameter]
- func (o *MLCLSTMLayer) Descriptor() *MLCLSTMDescriptor
- func (o *MLCLSTMLayer) GateActivations() *foundation.NSArray[*MLCActivationDescriptor]
- func (o *MLCLSTMLayer) HiddenWeights() *foundation.NSArray[*MLCTensor]
- func (o *MLCLSTMLayer) HiddenWeightsParameters() *foundation.NSArray[*MLCTensorParameter]
- func (o *MLCLSTMLayer) InputWeights() *foundation.NSArray[*MLCTensor]
- func (o *MLCLSTMLayer) InputWeightsParameters() *foundation.NSArray[*MLCTensorParameter]
- func (o *MLCLSTMLayer) OutputResultActivation() *MLCActivationDescriptor
- func (o *MLCLSTMLayer) PeepholeWeights() *foundation.NSArray[*MLCTensor]
- func (o *MLCLSTMLayer) PeepholeWeightsParameters() *foundation.NSArray[*MLCTensorParameter]
- type MLCLSTMResultMode
- type MLCLayer
- type MLCLayerNormalizationLayer
- func (o *MLCLayerNormalizationLayer) Beta() *MLCTensor
- func (o *MLCLayerNormalizationLayer) BetaParameter() *MLCTensorParameter
- func (o *MLCLayerNormalizationLayer) Gamma() *MLCTensor
- func (o *MLCLayerNormalizationLayer) GammaParameter() *MLCTensorParameter
- func (o *MLCLayerNormalizationLayer) NormalizedShape() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLCLayerNormalizationLayer) VarianceEpsilon() float32
- type MLCLossDescriptor
- func MLCLossDescriptorDescriptorWithTypeReductionType(lossType MLCLossType, reductionType MLCReductionType) *MLCLossDescriptor
- func MLCLossDescriptorDescriptorWithTypeReductionTypeWeight(lossType MLCLossType, reductionType MLCReductionType, weight float32) *MLCLossDescriptor
- func MLCLossDescriptorDescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount(lossType MLCLossType, reductionType MLCReductionType, weight float32, ...) *MLCLossDescriptor
- func MLCLossDescriptorDescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta(lossType MLCLossType, reductionType MLCReductionType, weight float32, ...) *MLCLossDescriptor
- func MLCLossDescriptorFromID(id objc.ID) *MLCLossDescriptor
- func (o *MLCLossDescriptor) ClassCount() uint
- func (o *MLCLossDescriptor) Delta() float32
- func (o *MLCLossDescriptor) Epsilon() float32
- func (o *MLCLossDescriptor) LabelSmoothing() float32
- func (o *MLCLossDescriptor) LossType() MLCLossType
- func (o *MLCLossDescriptor) ReductionType() MLCReductionType
- func (o *MLCLossDescriptor) Weight() float32
- type MLCLossLayer
- func MLCLossLayerCategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType MLCReductionType, labelSmoothing float32, classCount uint, ...) *MLCLossLayer
- func MLCLossLayerCategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType MLCReductionType, labelSmoothing float32, classCount uint, ...) *MLCLossLayer
- func MLCLossLayerCosineDistanceLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
- func MLCLossLayerCosineDistanceLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerFromID(id objc.ID) *MLCLossLayer
- func MLCLossLayerHingeLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
- func MLCLossLayerHingeLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerHuberLossWithReductionTypeDeltaWeight(reductionType MLCReductionType, delta float32, weight float32) *MLCLossLayer
- func MLCLossLayerHuberLossWithReductionTypeDeltaWeights(reductionType MLCReductionType, delta float32, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerLayerWithDescriptor(lossDescriptor *MLCLossDescriptor) *MLCLossLayer
- func MLCLossLayerLayerWithDescriptorWeights(lossDescriptor *MLCLossDescriptor, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerLogLossWithReductionTypeEpsilonWeight(reductionType MLCReductionType, epsilon float32, weight float32) *MLCLossLayer
- func MLCLossLayerLogLossWithReductionTypeEpsilonWeights(reductionType MLCReductionType, epsilon float32, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerMeanAbsoluteErrorLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
- func MLCLossLayerMeanAbsoluteErrorLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerMeanSquaredErrorLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
- func MLCLossLayerMeanSquaredErrorLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerSigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight(reductionType MLCReductionType, labelSmoothing float32, weight float32) *MLCLossLayer
- func MLCLossLayerSigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights(reductionType MLCReductionType, labelSmoothing float32, weights *MLCTensor) *MLCLossLayer
- func MLCLossLayerSoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType MLCReductionType, labelSmoothing float32, classCount uint, ...) *MLCLossLayer
- func MLCLossLayerSoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType MLCReductionType, labelSmoothing float32, classCount uint, ...) *MLCLossLayer
- type MLCLossType
- type MLCMatMulDescriptor
- type MLCMatMulLayer
- type MLCMultiheadAttentionDescriptor
- func MLCMultiheadAttentionDescriptorDescriptorWithModelDimensionHeadCount(modelDimension uint, headCount uint) *MLCMultiheadAttentionDescriptor
- func MLCMultiheadAttentionDescriptorDescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention(modelDimension uint, keyDimension uint, valueDimension uint, headCount uint, ...) *MLCMultiheadAttentionDescriptor
- func MLCMultiheadAttentionDescriptorFromID(id objc.ID) *MLCMultiheadAttentionDescriptor
- func (o *MLCMultiheadAttentionDescriptor) AddsZeroAttention() bool
- func (o *MLCMultiheadAttentionDescriptor) Dropout() float32
- func (o *MLCMultiheadAttentionDescriptor) HasAttentionBiases() bool
- func (o *MLCMultiheadAttentionDescriptor) HasBiases() bool
- func (o *MLCMultiheadAttentionDescriptor) HeadCount() uint
- func (o *MLCMultiheadAttentionDescriptor) KeyDimension() uint
- func (o *MLCMultiheadAttentionDescriptor) ModelDimension() uint
- func (o *MLCMultiheadAttentionDescriptor) ValueDimension() uint
- type MLCMultiheadAttentionLayer
- func (o *MLCMultiheadAttentionLayer) AttentionBiases() *foundation.NSArray[*MLCTensor]
- func (o *MLCMultiheadAttentionLayer) Biases() *foundation.NSArray[*MLCTensor]
- func (o *MLCMultiheadAttentionLayer) BiasesParameters() *foundation.NSArray[*MLCTensorParameter]
- func (o *MLCMultiheadAttentionLayer) Descriptor() *MLCMultiheadAttentionDescriptor
- func (o *MLCMultiheadAttentionLayer) Weights() *foundation.NSArray[*MLCTensor]
- func (o *MLCMultiheadAttentionLayer) WeightsParameters() *foundation.NSArray[*MLCTensorParameter]
- type MLCOptimizer
- func (o *MLCOptimizer) AppliesGradientClipping() bool
- func (o *MLCOptimizer) CustomGlobalNorm() float32
- func (o *MLCOptimizer) GradientClipMax() float32
- func (o *MLCOptimizer) GradientClipMin() float32
- func (o *MLCOptimizer) GradientClippingType() MLCGradientClippingType
- func (o *MLCOptimizer) GradientRescale() float32
- func (o *MLCOptimizer) LearningRate() float32
- func (o *MLCOptimizer) MaximumClippingNorm() float32
- func (o *MLCOptimizer) RegularizationScale() float32
- func (o *MLCOptimizer) RegularizationType() MLCRegularizationType
- func (o *MLCOptimizer) SetAppliesGradientClipping(appliesGradientClipping bool)
- func (o *MLCOptimizer) SetLearningRate(learningRate float32)
- type MLCOptimizerDescriptor
- func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, ...) *MLCOptimizerDescriptor
- func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, ...) *MLCOptimizerDescriptor
- func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, ...) *MLCOptimizerDescriptor
- func MLCOptimizerDescriptorFromID(id objc.ID) *MLCOptimizerDescriptor
- func (o *MLCOptimizerDescriptor) AppliesGradientClipping() bool
- func (o *MLCOptimizerDescriptor) CustomGlobalNorm() float32
- func (o *MLCOptimizerDescriptor) GradientClipMax() float32
- func (o *MLCOptimizerDescriptor) GradientClipMin() float32
- func (o *MLCOptimizerDescriptor) GradientClippingType() MLCGradientClippingType
- func (o *MLCOptimizerDescriptor) GradientRescale() float32
- func (o *MLCOptimizerDescriptor) LearningRate() float32
- func (o *MLCOptimizerDescriptor) MaximumClippingNorm() float32
- func (o *MLCOptimizerDescriptor) RegularizationScale() float32
- func (o *MLCOptimizerDescriptor) RegularizationType() MLCRegularizationType
- type MLCPaddingLayer
- func MLCPaddingLayerFromID(id objc.ID) *MLCPaddingLayer
- func MLCPaddingLayerLayerWithConstantPaddingConstantValue(padding *foundation.NSArray[*foundation.NSNumber], constantValue float32) *MLCPaddingLayer
- func MLCPaddingLayerLayerWithReflectionPadding(padding *foundation.NSArray[*foundation.NSNumber]) *MLCPaddingLayer
- func MLCPaddingLayerLayerWithSymmetricPadding(padding *foundation.NSArray[*foundation.NSNumber]) *MLCPaddingLayer
- func MLCPaddingLayerLayerWithZeroPadding(padding *foundation.NSArray[*foundation.NSNumber]) *MLCPaddingLayer
- type MLCPaddingPolicy
- type MLCPaddingType
- type MLCPlatform
- type MLCPoolingDescriptor
- func MLCPoolingDescriptorAveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCPoolingDescriptor
- func MLCPoolingDescriptorAveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCPoolingDescriptor
- func MLCPoolingDescriptorFromID(id objc.ID) *MLCPoolingDescriptor
- func MLCPoolingDescriptorL2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCPoolingDescriptor
- func MLCPoolingDescriptorL2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCPoolingDescriptor
- func MLCPoolingDescriptorMaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCPoolingDescriptor
- func MLCPoolingDescriptorMaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], ...) *MLCPoolingDescriptor
- func MLCPoolingDescriptorPoolingDescriptorWithTypeKernelSizeStride(poolingType MLCPoolingType, kernelSize uint, stride uint) *MLCPoolingDescriptor
- func (o *MLCPoolingDescriptor) CountIncludesPadding() bool
- func (o *MLCPoolingDescriptor) DilationRateInX() uint
- func (o *MLCPoolingDescriptor) DilationRateInY() uint
- func (o *MLCPoolingDescriptor) KernelHeight() uint
- func (o *MLCPoolingDescriptor) KernelWidth() uint
- func (o *MLCPoolingDescriptor) PaddingPolicy() MLCPaddingPolicy
- func (o *MLCPoolingDescriptor) PaddingSizeInX() uint
- func (o *MLCPoolingDescriptor) PaddingSizeInY() uint
- func (o *MLCPoolingDescriptor) PoolingType() MLCPoolingType
- func (o *MLCPoolingDescriptor) StrideInX() uint
- func (o *MLCPoolingDescriptor) StrideInY() uint
- type MLCPoolingLayer
- type MLCPoolingType
- type MLCRMSPropOptimizer
- func MLCRMSPropOptimizerFromID(id objc.ID) *MLCRMSPropOptimizer
- func MLCRMSPropOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCRMSPropOptimizer
- func MLCRMSPropOptimizerOptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered(optimizerDescriptor *MLCOptimizerDescriptor, momentumScale float32, ...) *MLCRMSPropOptimizer
- type MLCRandomInitializerType
- type MLCReductionLayer
- type MLCReductionType
- type MLCRegularizationType
- type MLCReshapeLayer
- type MLCSGDOptimizer
- func MLCSGDOptimizerFromID(id objc.ID) *MLCSGDOptimizer
- func MLCSGDOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCSGDOptimizer
- func MLCSGDOptimizerOptimizerWithDescriptorMomentumScaleUsesNesterovMomentum(optimizerDescriptor *MLCOptimizerDescriptor, momentumScale float32, ...) *MLCSGDOptimizer
- type MLCSampleMode
- type MLCScatterLayer
- type MLCSelectionLayer
- type MLCSliceLayer
- type MLCSoftmaxLayer
- type MLCSoftmaxOperation
- type MLCSplitLayer
- type MLCTensor
- func MLCTensorFromID(id objc.ID) *MLCTensor
- func MLCTensorTensorWithDescriptor(tensorDescriptor *MLCTensorDescriptor) *MLCTensor
- func MLCTensorTensorWithDescriptorData(tensorDescriptor *MLCTensorDescriptor, data *MLCTensorData) *MLCTensor
- func MLCTensorTensorWithDescriptorFillWithData(tensorDescriptor *MLCTensorDescriptor, fillData *foundation.NSNumber) *MLCTensor
- func MLCTensorTensorWithDescriptorRandomInitializerType(tensorDescriptor *MLCTensorDescriptor, ...) *MLCTensor
- func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSize(sequenceLength uint, featureChannelCount uint, batchSize uint) *MLCTensor
- func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSizeData(sequenceLength uint, featureChannelCount uint, batchSize uint, ...) *MLCTensor
- func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType(sequenceLength uint, featureChannelCount uint, batchSize uint, ...) *MLCTensor
- func MLCTensorTensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData(sequenceLengths *foundation.NSArray[*foundation.NSNumber], ...) *MLCTensor
- func MLCTensorTensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType(sequenceLengths *foundation.NSArray[*foundation.NSNumber], ...) *MLCTensor
- func MLCTensorTensorWithShape(shape *foundation.NSArray[*foundation.NSNumber]) *MLCTensor
- func MLCTensorTensorWithShapeDataDataType(shape *foundation.NSArray[*foundation.NSNumber], data *MLCTensorData, ...) *MLCTensor
- func MLCTensorTensorWithShapeDataType(shape *foundation.NSArray[*foundation.NSNumber], dataType MLCDataType) *MLCTensor
- func MLCTensorTensorWithShapeFillWithDataDataType(shape *foundation.NSArray[*foundation.NSNumber], fillData *foundation.NSNumber, ...) *MLCTensor
- func MLCTensorTensorWithShapeRandomInitializerType(shape *foundation.NSArray[*foundation.NSNumber], ...) *MLCTensor
- func MLCTensorTensorWithShapeRandomInitializerTypeDataType(shape *foundation.NSArray[*foundation.NSNumber], ...) *MLCTensor
- func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSize(width uint, height uint, featureChannelCount uint, batchSize uint) *MLCTensor
- func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeData(width uint, height uint, featureChannelCount uint, batchSize uint, ...) *MLCTensor
- func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType(width uint, height uint, featureChannelCount uint, batchSize uint, ...) *MLCTensor
- func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType(width uint, height uint, featureChannelCount uint, batchSize uint, ...) *MLCTensor
- func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType(width uint, height uint, featureChannelCount uint, batchSize uint, ...) *MLCTensor
- func (o *MLCTensor) BindAndWriteDataToDevice(data *MLCTensorData, device *MLCDevice) bool
- func (o *MLCTensor) BindOptimizerDataDeviceData(data *foundation.NSArray[*MLCTensorData], ...) bool
- func (o *MLCTensor) CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice(bytes_ unsafe.Pointer, length uint, synchronizeWithDevice bool) bool
- func (o *MLCTensor) Data() *foundation.NSData
- func (o *MLCTensor) Descriptor() *MLCTensorDescriptor
- func (o *MLCTensor) Device() *MLCDevice
- func (o *MLCTensor) HasValidNumerics() bool
- func (o *MLCTensor) Label() *foundation.NSString
- func (o *MLCTensor) OptimizerData() *foundation.NSArray[*MLCTensorData]
- func (o *MLCTensor) OptimizerDeviceData() *foundation.NSArray[*MLCTensorOptimizerDeviceData]
- func (o *MLCTensor) SetLabel(label *foundation.NSString)
- func (o *MLCTensor) SynchronizeData() bool
- func (o *MLCTensor) SynchronizeOptimizerData() bool
- func (o *MLCTensor) TensorByDequantizingToTypeScaleBias(type_ MLCDataType, scale *MLCTensor, bias *MLCTensor) *MLCTensor
- func (o *MLCTensor) TensorByDequantizingToTypeScaleBiasAxis(type_ MLCDataType, scale *MLCTensor, bias *MLCTensor, axis int) *MLCTensor
- func (o *MLCTensor) TensorByQuantizingToTypeScaleBias(type_ MLCDataType, scale float32, bias int) *MLCTensor
- func (o *MLCTensor) TensorByQuantizingToTypeScaleBiasAxis(type_ MLCDataType, scale *MLCTensor, bias *MLCTensor, axis int) *MLCTensor
- func (o *MLCTensor) TensorID() uint
- type MLCTensorData
- func MLCTensorDataDataWithBytesNoCopyLength(bytes_ unsafe.Pointer, length uint) *MLCTensorData
- func MLCTensorDataDataWithBytesNoCopyLengthDeallocator(bytes_ unsafe.Pointer, length uint, deallocator func(unsafe.Pointer, uint)) *MLCTensorData
- func MLCTensorDataDataWithImmutableBytesNoCopyLength(bytes_ unsafe.Pointer, length uint) *MLCTensorData
- func MLCTensorDataFromID(id objc.ID) *MLCTensorData
- type MLCTensorDescriptor
- func MLCTensorDescriptorConvolutionBiasesDescriptorWithFeatureChannelCountDataType(featureChannelCount uint, dataType MLCDataType) *MLCTensorDescriptor
- func MLCTensorDescriptorConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType(inputFeatureChannelCount uint, outputFeatureChannelCount uint, ...) *MLCTensorDescriptor
- func MLCTensorDescriptorConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType(width uint, height uint, inputFeatureChannelCount uint, ...) *MLCTensorDescriptor
- func MLCTensorDescriptorDescriptorWithShapeDataType(shape *foundation.NSArray[*foundation.NSNumber], dataType MLCDataType) *MLCTensorDescriptor
- func MLCTensorDescriptorDescriptorWithShapeSequenceLengthsSortedSequencesDataType(shape *foundation.NSArray[*foundation.NSNumber], ...) *MLCTensorDescriptor
- func MLCTensorDescriptorDescriptorWithWidthHeightFeatureChannelCountBatchSize(width uint, height uint, featureChannels uint, batchSize uint) *MLCTensorDescriptor
- func MLCTensorDescriptorDescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType(width uint, height uint, featureChannelCount uint, batchSize uint, ...) *MLCTensorDescriptor
- func MLCTensorDescriptorFromID(id objc.ID) *MLCTensorDescriptor
- func (o *MLCTensorDescriptor) BatchSizePerSequenceStep() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLCTensorDescriptor) DataType() MLCDataType
- func (o *MLCTensorDescriptor) DimensionCount() uint
- func (o *MLCTensorDescriptor) SequenceLengths() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLCTensorDescriptor) Shape() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLCTensorDescriptor) SortedSequences() bool
- func (o *MLCTensorDescriptor) Stride() *foundation.NSArray[*foundation.NSNumber]
- func (o *MLCTensorDescriptor) TensorAllocationSizeInBytes() uint
- type MLCTensorOptimizerDeviceData
- type MLCTensorParameter
- type MLCTrainingGraph
- func (o *MLCTrainingGraph) AddInputsLossLabels(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor], ...) bool
- func (o *MLCTrainingGraph) AddInputsLossLabelsLossLabelWeights(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor], ...) bool
- func (o *MLCTrainingGraph) AddOutputs(outputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
- func (o *MLCTrainingGraph) AllocateUserGradientForTensor(tensor *MLCTensor) *MLCTensor
- func (o *MLCTrainingGraph) BindOptimizerDataDeviceDataWithTensor(data *foundation.NSArray[*MLCTensorData], ...) bool
- func (o *MLCTrainingGraph) CompileOptimizer(optimizer *MLCOptimizer) bool
- func (o *MLCTrainingGraph) CompileWithOptionsDevice(options MLCGraphCompilationOptions, device *MLCDevice) bool
- func (o *MLCTrainingGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options MLCGraphCompilationOptions, device *MLCDevice, ...) bool
- func (o *MLCTrainingGraph) DeviceMemorySize() uint
- func (o *MLCTrainingGraph) ExecuteForwardWithBatchSizeOptionsCompletionHandler(batchSize uint, options MLCExecutionOptions, ...) bool
- func (o *MLCTrainingGraph) ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize uint, options MLCExecutionOptions, ...) bool
- func (o *MLCTrainingGraph) ExecuteGradientWithBatchSizeOptionsCompletionHandler(batchSize uint, options MLCExecutionOptions, ...) bool
- func (o *MLCTrainingGraph) ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize uint, options MLCExecutionOptions, ...) bool
- func (o *MLCTrainingGraph) ExecuteOptimizerUpdateWithOptionsCompletionHandler(options MLCExecutionOptions, ...) bool
- func (o *MLCTrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCTrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], ...) bool
- func (o *MLCTrainingGraph) GradientDataForParameterLayer(parameter *MLCTensor, layer *MLCLayer) *foundation.NSData
- func (o *MLCTrainingGraph) GradientTensorForInput(input *MLCTensor) *MLCTensor
- func (o *MLCTrainingGraph) LinkWithGraphs(graphs *foundation.NSArray[*MLCTrainingGraph]) bool
- func (o *MLCTrainingGraph) Optimizer() *MLCOptimizer
- func (o *MLCTrainingGraph) ResultGradientTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
- func (o *MLCTrainingGraph) SetTrainingTensorParameters(parameters *foundation.NSArray[*MLCTensorParameter]) bool
- func (o *MLCTrainingGraph) SourceGradientTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
- func (o *MLCTrainingGraph) StopGradientForTensors(tensors *foundation.NSArray[*MLCTensor]) bool
- func (o *MLCTrainingGraph) SynchronizeUpdates()
- type MLCTransposeLayer
- type MLCUpsampleLayer
- func MLCUpsampleLayerFromID(id objc.ID) *MLCUpsampleLayer
- func MLCUpsampleLayerLayerWithShape(shape *foundation.NSArray[*foundation.NSNumber]) *MLCUpsampleLayer
- func MLCUpsampleLayerLayerWithShapeSampleModeAlignsCorners(shape *foundation.NSArray[*foundation.NSNumber], sampleMode MLCSampleMode, ...) *MLCUpsampleLayer
- type MLCYOLOLossDescriptor
- func (o *MLCYOLOLossDescriptor) AnchorBoxCount() uint
- func (o *MLCYOLOLossDescriptor) AnchorBoxes() *foundation.NSData
- func (o *MLCYOLOLossDescriptor) MaximumIOUForObjectAbsence() float32
- func (o *MLCYOLOLossDescriptor) MinimumIOUForObjectPresence() float32
- func (o *MLCYOLOLossDescriptor) ScaleClassLoss() float32
- func (o *MLCYOLOLossDescriptor) ScaleNoObjectConfidenceLoss() float32
- func (o *MLCYOLOLossDescriptor) ScaleObjectConfidenceLoss() float32
- func (o *MLCYOLOLossDescriptor) ScaleSpatialPositionLoss() float32
- func (o *MLCYOLOLossDescriptor) ScaleSpatialSizeLoss() float32
- func (o *MLCYOLOLossDescriptor) SetMaximumIOUForObjectAbsence(maximumIOUForObjectAbsence float32)
- func (o *MLCYOLOLossDescriptor) SetMinimumIOUForObjectPresence(minimumIOUForObjectPresence float32)
- func (o *MLCYOLOLossDescriptor) SetScaleClassLoss(scaleClassLoss float32)
- func (o *MLCYOLOLossDescriptor) SetScaleNoObjectConfidenceLoss(scaleNoObjectConfidenceLoss float32)
- func (o *MLCYOLOLossDescriptor) SetScaleObjectConfidenceLoss(scaleObjectConfidenceLoss float32)
- func (o *MLCYOLOLossDescriptor) SetScaleSpatialPositionLoss(scaleSpatialPositionLoss float32)
- func (o *MLCYOLOLossDescriptor) SetScaleSpatialSizeLoss(scaleSpatialSizeLoss float32)
- func (o *MLCYOLOLossDescriptor) SetShouldRescore(shouldRescore bool)
- func (o *MLCYOLOLossDescriptor) ShouldRescore() bool
- type MLCYOLOLossLayer
- type Mach_vm_range_flags_t
- type Mach_vm_range_flavor_t
- type Mach_vm_range_tag_t
- type Mpo_flags_t
- type Os_clockid_t
- type Ptrauth_key
- type Qos_class_t
- type Virtual_memory_guard_exception_code_t
- type Xpc_listener_create_flags_t
- type Xpc_session_create_flags_t
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MLCActivationTypeDebugDescription ¶
func MLCActivationTypeDebugDescription(activationType MLCActivationType) *foundation.NSString
@abstract Returns a textual description of the activation type, suitable for debugging.
func MLCArithmeticOperationDebugDescription ¶
func MLCArithmeticOperationDebugDescription(operation MLCArithmeticOperation) *foundation.NSString
@abstract Returns a textual description of the arithmetic operation, suitable for debugging.
func MLCComparisonOperationDebugDescription ¶
func MLCComparisonOperationDebugDescription(operation MLCComparisonOperation) *foundation.NSString
@abstract Returns a textual description of the comparison operation, suitable for debugging.
func MLCConvolutionTypeDebugDescription ¶
func MLCConvolutionTypeDebugDescription(convolutionType MLCConvolutionType) *foundation.NSString
@abstract Returns a textual description of the convolution type, suitable for debugging.
func MLCGradientClippingTypeDebugDescription ¶
func MLCGradientClippingTypeDebugDescription(gradientClippingType MLCGradientClippingType) *foundation.NSString
@abstract Returns a textual description of the gradient clipping type, suitable for debugging.
func MLCLSTMResultModeDebugDescription ¶
func MLCLSTMResultModeDebugDescription(mode MLCLSTMResultMode) *foundation.NSString
@abstract Returns a textual description of the LSTM result mode, suitable for debugging.
func MLCLayerSupportsDataTypeOnDevice ¶
func MLCLayerSupportsDataTypeOnDevice(dataType MLCDataType, device *MLCDevice) bool
Returns a Boolean that indicates whether instances of this layer accept source tensors for the data type and device that you specify.
func MLCLossTypeDebugDescription ¶
func MLCLossTypeDebugDescription(lossType MLCLossType) *foundation.NSString
@abstract Returns a textual description of the loss type, suitable for debugging.
func MLCPaddingPolicyDebugDescription ¶
func MLCPaddingPolicyDebugDescription(paddingPolicy MLCPaddingPolicy) *foundation.NSString
@abstract Returns a textual description of the padding policy, suitable for debugging.
func MLCPaddingTypeDebugDescription ¶
func MLCPaddingTypeDebugDescription(paddingType MLCPaddingType) *foundation.NSString
@abstract Returns a textual description of the padding type, suitable for debugging.
func MLCPlatformGetRNGseed ¶
func MLCPlatformGetRNGseed() *foundation.NSNumber
Returns the global random number generator seed value.
func MLCPlatformSetRNGSeedTo ¶
func MLCPlatformSetRNGSeedTo(seed *foundation.NSNumber)
Sets the global random number generator seed value.
func MLCPoolingTypeDebugDescription ¶
func MLCPoolingTypeDebugDescription(poolingType MLCPoolingType) *foundation.NSString
@abstract Returns a textual description of the pooling type, suitable for debugging.
func MLCReductionTypeDebugDescription ¶
func MLCReductionTypeDebugDescription(reductionType MLCReductionType) *foundation.NSString
@abstract Returns a textual description of the reduction type, suitable for debugging.
func MLCSampleModeDebugDescription ¶
func MLCSampleModeDebugDescription(mode MLCSampleMode) *foundation.NSString
@abstract Returns a textual description of the sample mode, suitable for debugging.
func MLCSoftmaxOperationDebugDescription ¶
func MLCSoftmaxOperationDebugDescription(operation MLCSoftmaxOperation) *foundation.NSString
@abstract Returns a textual description of the softmax operation, suitable for debugging.
func MLCTensorDescriptorMaxTensorDimensions ¶
func MLCTensorDescriptorMaxTensorDimensions() uint
@property maxTensorDimensions @abstract The maximum number of tensor dimensions supported
func SymbolAvailable ¶
SymbolAvailable reports whether the named C symbol was bound when the library loaded. Calling a generated wrapper whose symbol is unavailable dereferences a nil function variable and panics.
Types ¶
type Acl_entry_id_t ¶
type Acl_entry_id_t int64
const ( ACL_FIRST_ENTRY Acl_entry_id_t = 0 ACL_NEXT_ENTRY Acl_entry_id_t = -1 ACL_LAST_ENTRY Acl_entry_id_t = -2 )
func (Acl_entry_id_t) String ¶
func (e Acl_entry_id_t) String() string
type Acl_flag_t ¶
type Acl_flag_t int64
const ( ACL_FLAG_DEFER_INHERIT Acl_flag_t = 1 ACL_FLAG_NO_INHERIT Acl_flag_t = 131072 ACL_ENTRY_INHERITED Acl_flag_t = 16 ACL_ENTRY_FILE_INHERIT Acl_flag_t = 32 ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64 ACL_ENTRY_LIMIT_INHERIT Acl_flag_t = 128 ACL_ENTRY_ONLY_INHERIT Acl_flag_t = 256 )
func (Acl_flag_t) String ¶
func (e Acl_flag_t) String() string
type Acl_perm_t ¶
type Acl_perm_t int64
const ( ACL_READ_DATA Acl_perm_t = 2 ACL_LIST_DIRECTORY Acl_perm_t = 2 ACL_WRITE_DATA Acl_perm_t = 4 ACL_ADD_FILE Acl_perm_t = 4 ACL_EXECUTE Acl_perm_t = 8 ACL_SEARCH Acl_perm_t = 8 ACL_DELETE Acl_perm_t = 16 ACL_APPEND_DATA Acl_perm_t = 32 ACL_ADD_SUBDIRECTORY Acl_perm_t = 32 ACL_DELETE_CHILD Acl_perm_t = 64 ACL_READ_ATTRIBUTES Acl_perm_t = 128 ACL_WRITE_ATTRIBUTES Acl_perm_t = 256 ACL_READ_EXTATTRIBUTES Acl_perm_t = 512 ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024 ACL_READ_SECURITY Acl_perm_t = 2048 ACL_WRITE_SECURITY Acl_perm_t = 4096 ACL_CHANGE_OWNER Acl_perm_t = 8192 ACL_SYNCHRONIZE Acl_perm_t = 1048576 )
func (Acl_perm_t) String ¶
func (e Acl_perm_t) String() string
type Acl_type_t ¶
type Acl_type_t int64
const ( ACL_TYPE_EXTENDED Acl_type_t = 256 ACL_TYPE_ACCESS Acl_type_t = 0 ACL_TYPE_DEFAULT Acl_type_t = 1 ACL_TYPE_AFS Acl_type_t = 2 ACL_TYPE_CODA Acl_type_t = 3 ACL_TYPE_NTFS Acl_type_t = 4 ACL_TYPE_NWFS Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
type Dispatch_autorelease_frequency_t ¶
type Dispatch_autorelease_frequency_t uint64
const ( DISPATCH_AUTORELEASE_FREQUENCY_INHERIT Dispatch_autorelease_frequency_t = 0 DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1 DISPATCH_AUTORELEASE_FREQUENCY_NEVER Dispatch_autorelease_frequency_t = 2 )
func (Dispatch_autorelease_frequency_t) String ¶
func (e Dispatch_autorelease_frequency_t) String() string
type Dispatch_block_flags_t ¶
type Dispatch_block_flags_t uint64
const ( DISPATCH_BLOCK_BARRIER Dispatch_block_flags_t = 1 DISPATCH_BLOCK_DETACHED Dispatch_block_flags_t = 2 DISPATCH_BLOCK_ASSIGN_CURRENT Dispatch_block_flags_t = 4 DISPATCH_BLOCK_NO_QOS_CLASS Dispatch_block_flags_t = 8 DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16 DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32 )
func (Dispatch_block_flags_t) String ¶
func (e Dispatch_block_flags_t) String() string
type Filesec_property_t ¶
type Filesec_property_t int64
const ( FILESEC_OWNER Filesec_property_t = 1 FILESEC_GROUP Filesec_property_t = 2 FILESEC_UUID Filesec_property_t = 3 FILESEC_MODE Filesec_property_t = 4 FILESEC_ACL Filesec_property_t = 5 FILESEC_GRPUUID Filesec_property_t = 6 FILESEC_ACL_RAW Filesec_property_t = 100 FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101 )
func (Filesec_property_t) String ¶
func (e Filesec_property_t) String() string
type Ipc_info_object_type_t ¶
type Ipc_info_object_type_t int64
const ( IPC_OTYPE_NONE Ipc_info_object_type_t = 0 IPC_OTYPE_THREAD_CONTROL Ipc_info_object_type_t = 1 IPC_OTYPE_TASK_CONTROL Ipc_info_object_type_t = 2 IPC_OTYPE_HOST Ipc_info_object_type_t = 3 IPC_OTYPE_HOST_PRIV Ipc_info_object_type_t = 4 IPC_OTYPE_PROCESSOR Ipc_info_object_type_t = 5 IPC_OTYPE_PROCESSOR_SET Ipc_info_object_type_t = 6 IPC_OTYPE_PROCESSOR_SET_NAME Ipc_info_object_type_t = 7 IPC_OTYPE_TIMER Ipc_info_object_type_t = 8 IPC_OTYPE_PORT_SUBST_ONCE Ipc_info_object_type_t = 9 IPC_OTYPE_MIG Ipc_info_object_type_t = 10 IPC_OTYPE_MEMORY_OBJECT Ipc_info_object_type_t = 11 IPC_OTYPE_XMM_PAGER Ipc_info_object_type_t = 12 IPC_OTYPE_XMM_KERNEL Ipc_info_object_type_t = 13 IPC_OTYPE_XMM_REPLY Ipc_info_object_type_t = 14 IPC_OTYPE_UND_REPLY Ipc_info_object_type_t = 15 IPC_OTYPE_HOST_NOTIFY Ipc_info_object_type_t = 16 IPC_OTYPE_HOST_SECURITY Ipc_info_object_type_t = 17 IPC_OTYPE_LEDGER Ipc_info_object_type_t = 18 IPC_OTYPE_MAIN_DEVICE Ipc_info_object_type_t = 19 IPC_OTYPE_TASK_NAME Ipc_info_object_type_t = 20 IPC_OTYPE_SUBSYSTEM Ipc_info_object_type_t = 21 IPC_OTYPE_IO_DONE_QUEUE Ipc_info_object_type_t = 22 IPC_OTYPE_SEMAPHORE Ipc_info_object_type_t = 23 IPC_OTYPE_LOCK_SET Ipc_info_object_type_t = 24 IPC_OTYPE_CLOCK Ipc_info_object_type_t = 25 IPC_OTYPE_CLOCK_CTRL Ipc_info_object_type_t = 26 IPC_OTYPE_IOKIT_IDENT Ipc_info_object_type_t = 27 IPC_OTYPE_NAMED_ENTRY Ipc_info_object_type_t = 28 IPC_OTYPE_IOKIT_CONNECT Ipc_info_object_type_t = 29 IPC_OTYPE_IOKIT_OBJECT Ipc_info_object_type_t = 30 IPC_OTYPE_UPL Ipc_info_object_type_t = 31 IPC_OTYPE_MEM_OBJ_CONTROL Ipc_info_object_type_t = 32 IPC_OTYPE_AU_SESSIONPORT Ipc_info_object_type_t = 33 IPC_OTYPE_FILEPORT Ipc_info_object_type_t = 34 IPC_OTYPE_LABELH Ipc_info_object_type_t = 35 IPC_OTYPE_TASK_RESUME Ipc_info_object_type_t = 36 IPC_OTYPE_VOUCHER Ipc_info_object_type_t = 37 IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38 IPC_OTYPE_WORK_INTERVAL Ipc_info_object_type_t = 39 IPC_OTYPE_UX_HANDLER Ipc_info_object_type_t = 40 IPC_OTYPE_UEXT_OBJECT Ipc_info_object_type_t = 41 IPC_OTYPE_ARCADE_REG Ipc_info_object_type_t = 42 IPC_OTYPE_EVENTLINK Ipc_info_object_type_t = 43 IPC_OTYPE_TASK_INSPECT Ipc_info_object_type_t = 44 IPC_OTYPE_TASK_READ Ipc_info_object_type_t = 45 IPC_OTYPE_THREAD_INSPECT Ipc_info_object_type_t = 46 IPC_OTYPE_THREAD_READ Ipc_info_object_type_t = 47 IPC_OTYPE_SUID_CRED Ipc_info_object_type_t = 48 IPC_OTYPE_HYPERVISOR Ipc_info_object_type_t = 49 IPC_OTYPE_TASK_ID_TOKEN Ipc_info_object_type_t = 50 IPC_OTYPE_TASK_FATAL Ipc_info_object_type_t = 51 IPC_OTYPE_KCDATA Ipc_info_object_type_t = 52 IPC_OTYPE_EXCLAVES_RESOURCE Ipc_info_object_type_t = 53 IPC_OTYPE_THREAD_RESUME Ipc_info_object_type_t = 54 IPC_OTYPE_UNKNOWN Ipc_info_object_type_t = 4294967295 )
func (Ipc_info_object_type_t) String ¶
func (e Ipc_info_object_type_t) String() string
type Launch_data_type_t ¶
type Launch_data_type_t int64
const ( LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1 LAUNCH_DATA_ARRAY Launch_data_type_t = 2 LAUNCH_DATA_FD Launch_data_type_t = 3 LAUNCH_DATA_INTEGER Launch_data_type_t = 4 LAUNCH_DATA_REAL Launch_data_type_t = 5 LAUNCH_DATA_BOOL Launch_data_type_t = 6 LAUNCH_DATA_STRING Launch_data_type_t = 7 LAUNCH_DATA_OPAQUE Launch_data_type_t = 8 LAUNCH_DATA_ERRNO Launch_data_type_t = 9 LAUNCH_DATA_MACHPORT Launch_data_type_t = 10 )
func (Launch_data_type_t) String ¶
func (e Launch_data_type_t) String() string
type MDLabelDomain ¶
type MDLabelDomain int64
@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().
const ( KMDLabelUserDomain MDLabelDomain = 0 KMDLabelLocalDomain MDLabelDomain = 1 )
func (MDLabelDomain) String ¶
func (e MDLabelDomain) String() string
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int64
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int64
@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
type MLCActivationDescriptor ¶
type MLCActivationDescriptor struct {
foundation.NSObject
}
A configuration object you use to create an activation layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcactivationdescriptor
func MLCActivationDescriptorDescriptorWithType ¶
func MLCActivationDescriptorDescriptorWithType(activationType MLCActivationType) *MLCActivationDescriptor
Creates an activation descriptor with the activation type you specify.
func MLCActivationDescriptorDescriptorWithTypeA ¶
func MLCActivationDescriptorDescriptorWithTypeA(activationType MLCActivationType, a float32) *MLCActivationDescriptor
Creates an activation descriptor with the activation type and parameter a that you specify.
func MLCActivationDescriptorDescriptorWithTypeAB ¶
func MLCActivationDescriptorDescriptorWithTypeAB(activationType MLCActivationType, a float32, b float32) *MLCActivationDescriptor
Creates an activation descriptor with the activation type and parameters a and b that you specify.
func MLCActivationDescriptorDescriptorWithTypeABC ¶
func MLCActivationDescriptorDescriptorWithTypeABC(activationType MLCActivationType, a float32, b float32, c float32) *MLCActivationDescriptor
Creates an activation descriptor with the activation type and parameters a, b, and c that you specify.
func MLCActivationDescriptorFromID ¶
func MLCActivationDescriptorFromID(id objc.ID) *MLCActivationDescriptor
func (*MLCActivationDescriptor) A ¶
func (o *MLCActivationDescriptor) A() float32
@property a @abstract Parameter to the activation function
func (*MLCActivationDescriptor) ActivationType ¶
func (o *MLCActivationDescriptor) ActivationType() MLCActivationType
@property activationType @abstract The type of activation function
func (*MLCActivationDescriptor) B ¶
func (o *MLCActivationDescriptor) B() float32
@property b @abstract Parameter to the activation function
func (*MLCActivationDescriptor) C ¶
func (o *MLCActivationDescriptor) C() float32
@property c @abstract Parameter to the activation function
type MLCActivationLayer ¶
type MLCActivationLayer struct {
MLCLayer
}
A layer that applies an activation function to the source tensor and produces an output.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcactivationlayer
func MLCActivationLayerAbsoluteLayer ¶
func MLCActivationLayerAbsoluteLayer() *MLCActivationLayer
@abstract Create an absolute activation layer @return A new activation layer
func MLCActivationLayerCeluLayer ¶
func MLCActivationLayerCeluLayer() *MLCActivationLayer
@abstract Create a CELU activation layer @return A new activation layer
func MLCActivationLayerCeluLayerWithA ¶
func MLCActivationLayerCeluLayerWithA(a float32) *MLCActivationLayer
@abstract Create a CELU activation layer @param a The \p a value for the CELU formation @return A new activation layer
func MLCActivationLayerClampLayerWithMinValueMaxValue ¶
func MLCActivationLayerClampLayerWithMinValueMaxValue(minValue float32, maxValue float32) *MLCActivationLayer
@abstract Create a clamp activation layer @param minValue The minimum range used by clamp @param maxValue The maximum range used by clamp @return A new activation layer
func MLCActivationLayerEluLayer ¶
func MLCActivationLayerEluLayer() *MLCActivationLayer
@abstract Create an ELU activation layer @return A new activation layer
func MLCActivationLayerEluLayerWithA ¶
func MLCActivationLayerEluLayerWithA(a float32) *MLCActivationLayer
@abstract Create an ELU activation layer @param a The \p a value for the ELU formation @return A new activation layer
func MLCActivationLayerFromID ¶
func MLCActivationLayerFromID(id objc.ID) *MLCActivationLayer
func MLCActivationLayerGeluLayer ¶
func MLCActivationLayerGeluLayer() *MLCActivationLayer
@abstract Create a GELU activation layer @return A new activation layer
func MLCActivationLayerHardShrinkLayer ¶
func MLCActivationLayerHardShrinkLayer() *MLCActivationLayer
@abstract Create a hard shrink activation layer @return A new activation layer
func MLCActivationLayerHardShrinkLayerWithA ¶
func MLCActivationLayerHardShrinkLayerWithA(a float32) *MLCActivationLayer
@abstract Create a hard shrink activation layer @param a The \p a value for the hard shrink formation @return A new activation layer
func MLCActivationLayerHardSigmoidLayer ¶
func MLCActivationLayerHardSigmoidLayer() *MLCActivationLayer
@abstract Create a hard sigmoid activation layer @return A new activation layer
func MLCActivationLayerHardSwishLayer ¶
func MLCActivationLayerHardSwishLayer() *MLCActivationLayer
@abstract Create a hardswish activation layer @return A new activation layer
func MLCActivationLayerLayerWithDescriptor ¶
func MLCActivationLayerLayerWithDescriptor(descriptor *MLCActivationDescriptor) *MLCActivationLayer
Creates an activation layer with the descriptor you specify.
func MLCActivationLayerLeakyReLULayer ¶
func MLCActivationLayerLeakyReLULayer() *MLCActivationLayer
@abstract Create a leaky ReLU activation layer @return A new activation layer
func MLCActivationLayerLeakyReLULayerWithNegativeSlope ¶
func MLCActivationLayerLeakyReLULayerWithNegativeSlope(negativeSlope float32) *MLCActivationLayer
@abstract Create a leaky ReLU activation layer @param negativeSlope Controls the angle of the negative slope @return A new activation layer
func MLCActivationLayerLinearLayerWithScaleBias ¶
func MLCActivationLayerLinearLayerWithScaleBias(scale float32, bias float32) *MLCActivationLayer
@abstract Create a linear activation layer @param scale The scale factor @param bias The bias value @return A new activation layer
func MLCActivationLayerLogSigmoidLayer ¶
func MLCActivationLayerLogSigmoidLayer() *MLCActivationLayer
@abstract Create a log sigmoid activation layer @return A new activation layer
func MLCActivationLayerRelu6Layer ¶
func MLCActivationLayerRelu6Layer() *MLCActivationLayer
@abstract Create a ReLU6 activation layer @return A new activation layer
func MLCActivationLayerReluLayer ¶
func MLCActivationLayerReluLayer() *MLCActivationLayer
@abstract Create a ReLU activation layer @return A new activation layer
func MLCActivationLayerRelunLayerWithAB ¶
func MLCActivationLayerRelunLayerWithAB(a float32, b float32) *MLCActivationLayer
@abstract Create a ReLUN activation layer @discussion This can be used to implement layers such as ReLU6 for example. @param a The \p a value @param b The \p b value @return A new activation layer
func MLCActivationLayerSeluLayer ¶
func MLCActivationLayerSeluLayer() *MLCActivationLayer
@abstract Create a SELU activation layer @return A new activation layer
func MLCActivationLayerSigmoidLayer ¶
func MLCActivationLayerSigmoidLayer() *MLCActivationLayer
@abstract Create a sigmoid activation layer @return A new activation layer
func MLCActivationLayerSoftPlusLayer ¶
func MLCActivationLayerSoftPlusLayer() *MLCActivationLayer
@abstract Create a soft plus activation layer @return A new activation layer
func MLCActivationLayerSoftPlusLayerWithBeta ¶
func MLCActivationLayerSoftPlusLayerWithBeta(beta float32) *MLCActivationLayer
@abstract Create a soft plus activation layer @param beta The beta value for the softplus formation @return A new activation layer
func MLCActivationLayerSoftShrinkLayer ¶
func MLCActivationLayerSoftShrinkLayer() *MLCActivationLayer
@abstract Create a soft shrink activation layer @return A new activation layer
func MLCActivationLayerSoftShrinkLayerWithA ¶
func MLCActivationLayerSoftShrinkLayerWithA(a float32) *MLCActivationLayer
@abstract Create a soft shrink activation layer @param a The \p a value for the soft shrink formation @return A new activation layer
func MLCActivationLayerSoftSignLayer ¶
func MLCActivationLayerSoftSignLayer() *MLCActivationLayer
@abstract Create a soft sign activation layer @return A new activation layer
func MLCActivationLayerTanhLayer ¶
func MLCActivationLayerTanhLayer() *MLCActivationLayer
@abstract Create a tanh activation layer @return A new activation layer
func MLCActivationLayerTanhShrinkLayer ¶
func MLCActivationLayerTanhShrinkLayer() *MLCActivationLayer
@abstract Create a TanhShrink activation layer @return A new activation layer
func MLCActivationLayerThresholdLayerWithThresholdReplacement ¶
func MLCActivationLayerThresholdLayerWithThresholdReplacement(threshold float32, replacement float32) *MLCActivationLayer
@abstract Create a threshold activation layer @param threshold The value to threshold at @param replacement The value to replace with @return A new activation layer
func (*MLCActivationLayer) Descriptor ¶
func (o *MLCActivationLayer) Descriptor() *MLCActivationDescriptor
@property descriptor @abstract The activation descriptor
type MLCActivationType ¶
type MLCActivationType int64
An activation type that you specify for an activation descriptor.
const ( // An activation type that implements the identity function. MLCActivationTypeNone MLCActivationType = 0 // An activation type that implements the rectified linear unit activation function. MLCActivationTypeReLU MLCActivationType = 1 // An activation type that implements the linear activation function. MLCActivationTypeLinear MLCActivationType = 2 // An activation type that implements the sigmoid activation function. MLCActivationTypeSigmoid MLCActivationType = 3 // An activation type that implements the hard sigmoid activation function. MLCActivationTypeHardSigmoid MLCActivationType = 4 // An activation type that implements the hyperbolic tangent activation function. MLCActivationTypeTanh MLCActivationType = 5 // An activation type that implements the absolute activation function. MLCActivationTypeAbsolute MLCActivationType = 6 // An activation type that implements the soft plus activation function. MLCActivationTypeSoftPlus MLCActivationType = 7 // An activation type that implements the parametric soft sign activation function. MLCActivationTypeSoftSign MLCActivationType = 8 // An activation type that implements the exponential linear unit activation function. MLCActivationTypeELU MLCActivationType = 9 // An activation type that implements the ReLUN activation function. MLCActivationTypeReLUN MLCActivationType = 10 // An activation type that implements the log sigmoid activation function. MLCActivationTypeLogSigmoid MLCActivationType = 11 // An activation type that implements the scaled exponential linear unit activation function. MLCActivationTypeSELU MLCActivationType = 12 // An activation type that implements the CELU activation function. MLCActivationTypeCELU MLCActivationType = 13 // An activation type that implements the hard shrink activation function. MLCActivationTypeHardShrink MLCActivationType = 14 // An activation type that implements the soft shrink activation function. MLCActivationTypeSoftShrink MLCActivationType = 15 // An activation type that implements the hyperbolic tangent shrink activation function. MLCActivationTypeTanhShrink MLCActivationType = 16 // An activation type that implements the threshold activation function. MLCActivationTypeThreshold MLCActivationType = 17 // An activation type that implements the gaussian error linear unit activation function. MLCActivationTypeGELU MLCActivationType = 18 // An activation type that implements the hard swish activation function. MLCActivationTypeHardSwish MLCActivationType = 19 // An activation type that implements the clamp activation function. MLCActivationTypeClamp MLCActivationType = 20 // The count of activation types. MLCActivationTypeCount MLCActivationType = 21 )
func (MLCActivationType) String ¶
func (e MLCActivationType) String() string
type MLCAdamOptimizer ¶
type MLCAdamOptimizer struct {
MLCOptimizer
}
An optimizer that represents the adaptive moment estimation algorithm.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcadamoptimizer
func MLCAdamOptimizerFromID ¶
func MLCAdamOptimizerFromID(id objc.ID) *MLCAdamOptimizer
func MLCAdamOptimizerOptimizerWithDescriptor ¶
func MLCAdamOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCAdamOptimizer
Creates an Adam optimizer with the descriptor you specify.
func MLCAdamOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonTimeStep ¶
func MLCAdamOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonTimeStep(optimizerDescriptor *MLCOptimizerDescriptor, beta1 float32, beta2 float32, epsilon float32, timeStep uint) *MLCAdamOptimizer
Creates an Adam optimizer with the values you specify.
func MLCAdamOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep ¶
func MLCAdamOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *MLCOptimizerDescriptor, beta1 float32, beta2 float32, epsilon float32, usesAMSGrad bool, timeStep uint) *MLCAdamOptimizer
Creates an Adam optimizer with the values you specify.
func (*MLCAdamOptimizer) Beta1 ¶
func (o *MLCAdamOptimizer) Beta1() float32
@property beta1 @abstract Coefficent used for computing running averages of gradient. @discussion The default is 0.9.
func (*MLCAdamOptimizer) Beta2 ¶
func (o *MLCAdamOptimizer) Beta2() float32
@property beta2 @abstract Coefficent used for computing running averages of square of gradient. @discussion The default is 0.999.
func (*MLCAdamOptimizer) Epsilon ¶
func (o *MLCAdamOptimizer) Epsilon() float32
func (*MLCAdamOptimizer) TimeStep ¶
func (o *MLCAdamOptimizer) TimeStep() uint
@property timeStep @abstract The current timestep used for the update. @discussion The default is 1.
func (*MLCAdamOptimizer) UsesAMSGrad ¶
func (o *MLCAdamOptimizer) UsesAMSGrad() bool
@property usesAMSGrad @abstract Whether to use the AMSGrad variant of this algorithm @discussion The default is false
type MLCAdamWOptimizer ¶
type MLCAdamWOptimizer struct {
MLCOptimizer
}
An optimizer that represents the Adam algorithm with weight decay.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcadamwoptimizer
func MLCAdamWOptimizerFromID ¶
func MLCAdamWOptimizerFromID(id objc.ID) *MLCAdamWOptimizer
func MLCAdamWOptimizerOptimizerWithDescriptor ¶
func MLCAdamWOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCAdamWOptimizer
Creates a default optimizer with the descriptor you specify.
func MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep ¶
func MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *MLCOptimizerDescriptor, beta1 float32, beta2 float32, epsilon float32, usesAMSGrad bool, timeStep uint) *MLCAdamWOptimizer
Creates an AdamW optimizer with the values you specify.
func (*MLCAdamWOptimizer) Beta1 ¶
func (o *MLCAdamWOptimizer) Beta1() float32
@property beta1 @abstract Coefficent used for computing running averages of gradient. @discussion The default is 0.9.
func (*MLCAdamWOptimizer) Beta2 ¶
func (o *MLCAdamWOptimizer) Beta2() float32
@property beta2 @abstract Coefficent used for computing running averages of square of gradient. @discussion The default is 0.999.
func (*MLCAdamWOptimizer) Epsilon ¶
func (o *MLCAdamWOptimizer) Epsilon() float32
@property epsilon @abstract A term added to improve numerical stability. @discussion The default is 1e-8.
func (*MLCAdamWOptimizer) TimeStep ¶
func (o *MLCAdamWOptimizer) TimeStep() uint
@property timeStep @abstract The current timestep used for the update. @discussion The default is 1.
func (*MLCAdamWOptimizer) UsesAMSGrad ¶
func (o *MLCAdamWOptimizer) UsesAMSGrad() bool
@property usesAMSGrad @abstract Whether to use the AMSGrad variant of this algorithm @discussion The default is false
type MLCArithmeticLayer ¶
type MLCArithmeticLayer struct {
MLCLayer
}
A layer that performs an arithmetic operation.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcarithmeticlayer
func MLCArithmeticLayerFromID ¶
func MLCArithmeticLayerFromID(id objc.ID) *MLCArithmeticLayer
func MLCArithmeticLayerLayerWithOperation ¶
func MLCArithmeticLayerLayerWithOperation(operation MLCArithmeticOperation) *MLCArithmeticLayer
Creates an arithmetic layer with the operation you specify.
func (*MLCArithmeticLayer) Operation ¶
func (o *MLCArithmeticLayer) Operation() MLCArithmeticOperation
@property operation @abstract The arithmetic operation.
type MLCArithmeticOperation ¶
type MLCArithmeticOperation int64
Constants that describe an arithmetic operation.
const ( // Calculates the element-wise sum of the inputs. MLCArithmeticOperationAdd MLCArithmeticOperation = 0 // Calculates the element-wise difference between the inputs. MLCArithmeticOperationSubtract MLCArithmeticOperation = 1 // Calculates the element-wise product of the inputs. MLCArithmeticOperationMultiply MLCArithmeticOperation = 2 // Calculates the element-wise division of the inputs. MLCArithmeticOperationDivide MLCArithmeticOperation = 3 // Calculates the element-wise floor of the inputs. MLCArithmeticOperationFloor MLCArithmeticOperation = 4 // Calculates the element-wise rounding of the inputs. MLCArithmeticOperationRound MLCArithmeticOperation = 5 // Calculates the element-wise ceiling of the inputs. MLCArithmeticOperationCeil MLCArithmeticOperation = 6 // Calculates the element-wise square root of the input. MLCArithmeticOperationSqrt MLCArithmeticOperation = 7 // Calculates the element-wise reciprocal of the square root of the input. MLCArithmeticOperationRsqrt MLCArithmeticOperation = 8 // Calculates the element-wise sine of the input. MLCArithmeticOperationSin MLCArithmeticOperation = 9 // Calculates the element-wise cosine of the input. MLCArithmeticOperationCos MLCArithmeticOperation = 10 // Calculates the element-wise tangent of the input. MLCArithmeticOperationTan MLCArithmeticOperation = 11 // Calculates the element-wise inverse sine of the input. MLCArithmeticOperationAsin MLCArithmeticOperation = 12 // Calculates the element-wise inverse cosine of the input. MLCArithmeticOperationAcos MLCArithmeticOperation = 13 // Calculates the element-wise inverse tangent of the input. MLCArithmeticOperationAtan MLCArithmeticOperation = 14 // Calculates the element-wise hyperbolic sine of the input. MLCArithmeticOperationSinh MLCArithmeticOperation = 15 // Calculates the element-wise hyperbolic cosine of the input. MLCArithmeticOperationCosh MLCArithmeticOperation = 16 // Calculates the element-wise hyperbolic tangent of the input. MLCArithmeticOperationTanh MLCArithmeticOperation = 17 // Calculates the element-wise inverse hyperbolic sine of the input. MLCArithmeticOperationAsinh MLCArithmeticOperation = 18 // Calculates the element-wise inverse hyperbolic cosine of the input. MLCArithmeticOperationAcosh MLCArithmeticOperation = 19 // Calculates the element-wise inverse hyperbolic tangent of the input. MLCArithmeticOperationAtanh MLCArithmeticOperation = 20 // Calculates the element-wise first input raised to the power of the second input. MLCArithmeticOperationPow MLCArithmeticOperation = 21 // Calculates the element-wise result of the exponent raised to the power of the input. MLCArithmeticOperationExp MLCArithmeticOperation = 22 // Calculates the element-wise result of the number 2 raised to the power of the input. MLCArithmeticOperationExp2 MLCArithmeticOperation = 23 // Calculates the element-wise natural logarithm of the input. MLCArithmeticOperationLog MLCArithmeticOperation = 24 // Calculates the element-wise base 2 logarithm of the input. MLCArithmeticOperationLog2 MLCArithmeticOperation = 25 // Calculates the element-wise product of the inputs, and returns 0 when the result isn’t a number or infinity. MLCArithmeticOperationMultiplyNoNaN MLCArithmeticOperation = 26 // Calculates the element-wise division of the inputs, and returns 0 if the denominator is 0. MLCArithmeticOperationDivideNoNaN MLCArithmeticOperation = 27 // Calculates the element-wise minimum of the inputs. MLCArithmeticOperationMin MLCArithmeticOperation = 28 // Calculates the element-wise maximum the inputs. MLCArithmeticOperationMax MLCArithmeticOperation = 29 // The total number of arithmetic operations. MLCArithmeticOperationCount MLCArithmeticOperation = 30 )
func (MLCArithmeticOperation) String ¶
func (e MLCArithmeticOperation) String() string
type MLCBatchNormalizationLayer ¶
type MLCBatchNormalizationLayer struct {
MLCLayer
}
A layer that normalizes a batch of inputs.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcbatchnormalizationlayer
func MLCBatchNormalizationLayerFromID ¶
func MLCBatchNormalizationLayerFromID(id objc.ID) *MLCBatchNormalizationLayer
func MLCBatchNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon ¶
func MLCBatchNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon(featureChannelCount uint, mean *MLCTensor, variance *MLCTensor, beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32) *MLCBatchNormalizationLayer
Creates a batch normalization layer with the number of feature channels, tensors, and variance epsilon you specify.
func MLCBatchNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum ¶
func MLCBatchNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount uint, mean *MLCTensor, variance *MLCTensor, beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32, momentum float32) *MLCBatchNormalizationLayer
Creates a batch normalization layer with the number of feature channels, tensors, variance epsilon, and momentum you specify.
func (*MLCBatchNormalizationLayer) Beta ¶
func (o *MLCBatchNormalizationLayer) Beta() *MLCTensor
@property beta @abstract The beta tensor
func (*MLCBatchNormalizationLayer) BetaParameter ¶
func (o *MLCBatchNormalizationLayer) BetaParameter() *MLCTensorParameter
@property betaParameter @abstract The beta tensor parameter used for optimizer update
func (*MLCBatchNormalizationLayer) FeatureChannelCount ¶
func (o *MLCBatchNormalizationLayer) FeatureChannelCount() uint
@property featureChannelCount @abstract The number of feature channels
func (*MLCBatchNormalizationLayer) Gamma ¶
func (o *MLCBatchNormalizationLayer) Gamma() *MLCTensor
@property gamma @abstract The gamma tensor
func (*MLCBatchNormalizationLayer) GammaParameter ¶
func (o *MLCBatchNormalizationLayer) GammaParameter() *MLCTensorParameter
@property gammaParameter @abstract The gamma tensor parameter used for optimizer update
func (*MLCBatchNormalizationLayer) Mean ¶
func (o *MLCBatchNormalizationLayer) Mean() *MLCTensor
@property mean @abstract The mean tensor
func (*MLCBatchNormalizationLayer) Momentum ¶
func (o *MLCBatchNormalizationLayer) Momentum() float32
@property momentum @abstract The value used for the running mean and variance computation @discussion The default is 0.99f.
func (*MLCBatchNormalizationLayer) Variance ¶
func (o *MLCBatchNormalizationLayer) Variance() *MLCTensor
@property variance @abstract The variance tensor
func (*MLCBatchNormalizationLayer) VarianceEpsilon ¶
func (o *MLCBatchNormalizationLayer) VarianceEpsilon() float32
@property varianceEpsilon @abstract A value used for numerical stability
type MLCComparisonLayer ¶
type MLCComparisonLayer struct {
MLCLayer
}
A layer that performs elementwise comparison of two tensors.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlccomparisonlayer
func MLCComparisonLayerFromID ¶
func MLCComparisonLayerFromID(id objc.ID) *MLCComparisonLayer
func MLCComparisonLayerLayerWithOperation ¶
func MLCComparisonLayerLayerWithOperation(operation MLCComparisonOperation) *MLCComparisonLayer
Creates a comparison layer with the operation you specify.
func (*MLCComparisonLayer) Operation ¶
func (o *MLCComparisonLayer) Operation() MLCComparisonOperation
type MLCComparisonOperation ¶
type MLCComparisonOperation int64
A comparison operation.
const ( MLCComparisonOperationEqual MLCComparisonOperation = 0 MLCComparisonOperationNotEqual MLCComparisonOperation = 1 MLCComparisonOperationLess MLCComparisonOperation = 2 MLCComparisonOperationGreater MLCComparisonOperation = 3 MLCComparisonOperationLessOrEqual MLCComparisonOperation = 4 MLCComparisonOperationGreaterOrEqual MLCComparisonOperation = 5 MLCComparisonOperationLogicalAND MLCComparisonOperation = 6 MLCComparisonOperationLogicalOR MLCComparisonOperation = 7 MLCComparisonOperationLogicalNOT MLCComparisonOperation = 8 MLCComparisonOperationLogicalNAND MLCComparisonOperation = 9 MLCComparisonOperationLogicalNOR MLCComparisonOperation = 10 MLCComparisonOperationLogicalXOR MLCComparisonOperation = 11 // A number that represents the operation count. MLCComparisonOperationCount MLCComparisonOperation = 12 )
func (MLCComparisonOperation) String ¶
func (e MLCComparisonOperation) String() string
type MLCConcatenationLayer ¶
type MLCConcatenationLayer struct {
MLCLayer
}
A layer that combines tensors into a single tensor.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcconcatenationlayer
func MLCConcatenationLayerFromID ¶
func MLCConcatenationLayerFromID(id objc.ID) *MLCConcatenationLayer
func MLCConcatenationLayerLayer ¶
func MLCConcatenationLayerLayer() *MLCConcatenationLayer
Creates a concatenation layer with a dimension value of 1, which typically represents feature channels.
func MLCConcatenationLayerLayerWithDimension ¶
func MLCConcatenationLayerLayerWithDimension(dimension uint) *MLCConcatenationLayer
Creates a concatenation layer with the dimension you specify.
func (*MLCConcatenationLayer) Dimension ¶
func (o *MLCConcatenationLayer) Dimension() uint
@property dimension @abstract The dimension (or axis) along which to concatenate tensors @discussion The default value is 1 (which typically represents features channels)
type MLCConvolutionDescriptor ¶
type MLCConvolutionDescriptor struct {
foundation.NSObject
}
A configuration object you use to create a convolution or fully connected layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcconvolutiondescriptor
func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, outputFeatureChannelCount uint, groupCount uint, strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a convolution transpose descriptor with the kernel and padding options, number of feature channels and groups, and dilation rates you specify.
func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, outputFeatureChannelCount uint, strides *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a convolution transpose descriptor with the kernel sizes, number of feature channels, strides, and padding options you specify.
func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount ¶
func MLCConvolutionDescriptorConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth uint, kernelHeight uint, inputFeatureChannelCount uint, outputFeatureChannelCount uint) *MLCConvolutionDescriptor
Creates a descriptor for convolution transpose with the kernel sizes and number of feature channels you specify.
func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, channelMultiplier uint, strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a convolution descriptor with the kernel and padding options, number of input channels, channel multiplier, and dilation rates you specify.
func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, channelMultiplier uint, strides *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a depthwise convolution descriptor with the kernel and padding options, number of input feature channels, and channel multiplier you specify.
func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier ¶
func MLCConvolutionDescriptorDepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier(kernelWidth uint, kernelHeight uint, inputFeatureChannelCount uint, channelMultiplier uint) *MLCConvolutionDescriptor
Creates a descriptor for depthwise convolution with the kernel sizes, number of input feature channels, and channel multiplier you specify.
func MLCConvolutionDescriptorDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, outputFeatureChannelCount uint, groupCount uint, strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a convolution descriptor with the kernel and padding options, number of feature channels and groups, and dilation rates you specify.
func MLCConvolutionDescriptorDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, outputFeatureChannelCount uint, strides *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a convolution descriptor with the kernel sizes, number of feature channels, strides, padding policy, and padding sizes you specify.
func MLCConvolutionDescriptorDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount ¶
func MLCConvolutionDescriptorDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth uint, kernelHeight uint, inputFeatureChannelCount uint, outputFeatureChannelCount uint) *MLCConvolutionDescriptor
Creates a convolution descriptor with the kernel sizes and number of feature channels you specify.
func MLCConvolutionDescriptorDescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes ¶
func MLCConvolutionDescriptorDescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(convolutionType MLCConvolutionType, kernelSizes *foundation.NSArray[*foundation.NSNumber], inputFeatureChannelCount uint, outputFeatureChannelCount uint, groupCount uint, strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCConvolutionDescriptor
Creates a descriptor with the type, kernel sizes, number of feature channels and groups, strides, dilation rates, and padding policy you specify.
func MLCConvolutionDescriptorFromID ¶
func MLCConvolutionDescriptorFromID(id objc.ID) *MLCConvolutionDescriptor
func (*MLCConvolutionDescriptor) ConvolutionType ¶
func (o *MLCConvolutionDescriptor) ConvolutionType() MLCConvolutionType
@property convolutionType @abstract The type of convolution.
func (*MLCConvolutionDescriptor) DilationRateInX ¶
func (o *MLCConvolutionDescriptor) DilationRateInX() uint
@property dilationRateInX @abstract The dilation rate i.e. stride of elements in the kernel in x.
func (*MLCConvolutionDescriptor) DilationRateInY ¶
func (o *MLCConvolutionDescriptor) DilationRateInY() uint
@property dilationRateInY @abstract The dilation rate i.e. stride of elements in the kernel in y.
func (*MLCConvolutionDescriptor) GroupCount ¶
func (o *MLCConvolutionDescriptor) GroupCount() uint
@property groupCount @abstract Number of blocked connections from input channels to output channels
func (*MLCConvolutionDescriptor) InputFeatureChannelCount ¶
func (o *MLCConvolutionDescriptor) InputFeatureChannelCount() uint
@property inputFeatureChannelCount @abstract Number of channels in the input tensor
func (*MLCConvolutionDescriptor) IsConvolutionTranspose ¶
func (o *MLCConvolutionDescriptor) IsConvolutionTranspose() bool
@property isConvolutionTranspose @abstract A flag to indicate if this is a convolution transpose
func (*MLCConvolutionDescriptor) KernelHeight ¶
func (o *MLCConvolutionDescriptor) KernelHeight() uint
@property kernelHeight @abstract The convolution kernel size in y.
func (*MLCConvolutionDescriptor) KernelWidth ¶
func (o *MLCConvolutionDescriptor) KernelWidth() uint
@property kernelWidth @abstract The convolution kernel size in x.
func (*MLCConvolutionDescriptor) OutputFeatureChannelCount ¶
func (o *MLCConvolutionDescriptor) OutputFeatureChannelCount() uint
@property outputFeatureChannelCount @abstract Number of channels in the output tensor
func (*MLCConvolutionDescriptor) PaddingPolicy ¶
func (o *MLCConvolutionDescriptor) PaddingPolicy() MLCPaddingPolicy
@property paddingPolicy @abstract The padding policy to use.
func (*MLCConvolutionDescriptor) PaddingSizeInX ¶
func (o *MLCConvolutionDescriptor) PaddingSizeInX() uint
@property paddingSizeInX @abstract The pooling size in x (left and right) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*MLCConvolutionDescriptor) PaddingSizeInY ¶
func (o *MLCConvolutionDescriptor) PaddingSizeInY() uint
@property paddingSizeInY @abstract The pooling size in y (top and bottom) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*MLCConvolutionDescriptor) StrideInX ¶
func (o *MLCConvolutionDescriptor) StrideInX() uint
@property strideInX @abstract The stride of the kernel in x.
func (*MLCConvolutionDescriptor) StrideInY ¶
func (o *MLCConvolutionDescriptor) StrideInY() uint
@property strideInY @abstract The stride of the kernel in y.
func (*MLCConvolutionDescriptor) UsesDepthwiseConvolution ¶
func (o *MLCConvolutionDescriptor) UsesDepthwiseConvolution() bool
@property usesDepthwiseConvolution @abstract A flag to indicate depthwise convolution
type MLCConvolutionLayer ¶
type MLCConvolutionLayer struct {
MLCLayer
}
A layer that applies a convolution over a signal.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcconvolutionlayer
func MLCConvolutionLayerFromID ¶
func MLCConvolutionLayerFromID(id objc.ID) *MLCConvolutionLayer
func MLCConvolutionLayerLayerWithWeightsBiasesDescriptor ¶
func MLCConvolutionLayerLayerWithWeightsBiasesDescriptor(weights *MLCTensor, biases *MLCTensor, descriptor *MLCConvolutionDescriptor) *MLCConvolutionLayer
Creates a convolution layer with the weights, biases, and descriptor you specify.
func (*MLCConvolutionLayer) Biases ¶
func (o *MLCConvolutionLayer) Biases() *MLCTensor
@property biases @abstract The bias tensor used by the convolution layer
func (*MLCConvolutionLayer) BiasesParameter ¶
func (o *MLCConvolutionLayer) BiasesParameter() *MLCTensorParameter
@property biasesParameter @abstract The bias tensor parameter used for optimizer update
func (*MLCConvolutionLayer) Descriptor ¶
func (o *MLCConvolutionLayer) Descriptor() *MLCConvolutionDescriptor
@property descriptor @abstract The convolution descriptor
func (*MLCConvolutionLayer) Weights ¶
func (o *MLCConvolutionLayer) Weights() *MLCTensor
@property weights @abstract The weights tensor used by the convolution layer
func (*MLCConvolutionLayer) WeightsParameter ¶
func (o *MLCConvolutionLayer) WeightsParameter() *MLCTensorParameter
@property weightsParameter @abstract The weights tensor parameter used for optimizer update
type MLCConvolutionType ¶
type MLCConvolutionType int64
The convolution type specified for a convolution layer.
const ( // The standard convolution type. MLCConvolutionTypeStandard MLCConvolutionType = 0 // The transposed convolution type. MLCConvolutionTypeTransposed MLCConvolutionType = 1 // The depthwise convolution type. MLCConvolutionTypeDepthwise MLCConvolutionType = 2 )
func (MLCConvolutionType) String ¶
func (e MLCConvolutionType) String() string
type MLCDataType ¶
type MLCDataType int64
A tensor data type.
const ( MLCDataTypeInvalid MLCDataType = 0 // The 32-bit floating-point data type. MLCDataTypeFloat32 MLCDataType = 1 // The 16-bit floating-point data type. MLCDataTypeFloat16 MLCDataType = 3 // The Boolean data type. MLCDataTypeBoolean MLCDataType = 4 // The 64-bit integer data type. MLCDataTypeInt64 MLCDataType = 5 // The 32-bit integer data type. MLCDataTypeInt32 MLCDataType = 7 // The 8-bit integer data type. MLCDataTypeInt8 MLCDataType = 8 // The 8-bit unsigned integer data type. MLCDataTypeUInt8 MLCDataType = 9 MLCDataTypeCount MLCDataType = 10 )
func (MLCDataType) String ¶
func (e MLCDataType) String() string
type MLCDevice ¶
type MLCDevice struct {
foundation.NSObject
}
An object that represents the CPU or one or more GPUs the framework uses to execute a neural network.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcdevice
func MLCDeviceAneDevice ¶
func MLCDeviceAneDevice() *MLCDevice
Creates a device that uses the Apple Neural Engine, if one exists.
func MLCDeviceDeviceWithGPUDevices ¶
func MLCDeviceDeviceWithGPUDevices(gpus *foundation.NSArray[metal.MTLDevice]) *MLCDevice
Creates a device using the GPUs you specify.
func MLCDeviceDeviceWithType ¶
func MLCDeviceDeviceWithType(type_ MLCDeviceType) *MLCDevice
Creates a device of the type you specify.
func MLCDeviceDeviceWithTypeSelectsMultipleComputeDevices ¶
func MLCDeviceDeviceWithTypeSelectsMultipleComputeDevices(type_ MLCDeviceType, selectsMultipleComputeDevices bool) *MLCDevice
Creates a device that you can configure to use multiple compute devices.
func MLCDeviceFromID ¶
func MLCDeviceGpuDevice ¶
func MLCDeviceGpuDevice() *MLCDevice
Creates a device that uses a GPU, if one exists.
func (*MLCDevice) ActualDeviceType ¶
func (o *MLCDevice) ActualDeviceType() MLCDeviceType
@property actualDeviceType @abstract The specific device selected. @discussion This can be CPU, GPU or ANE. If type is MLCDeviceTypeAny, this property can be used to find out the specific device type that is selected.
func (*MLCDevice) GpuDevices ¶
func (o *MLCDevice) GpuDevices() *foundation.NSArray[metal.MTLDevice]
func (*MLCDevice) Type ¶
func (o *MLCDevice) Type() MLCDeviceType
@property type @abstract The type specified when the device is created @discussion Recommend that developers use MLCDeviceTypeAny as the device type. This will ensure that MLCompute will select the best device to execute the neural network. If developers want to be able to control device selection, they can select CPU or GPU and for the GPU, they can also select a specific Metal device.
type MLCDeviceType ¶
type MLCDeviceType int64
A device type for execution of a neural network.
const ( // A device type that represents the CPU. MLCDeviceTypeCPU MLCDeviceType = 0 // A device type that represents the GPU. MLCDeviceTypeGPU MLCDeviceType = 1 // A device type that represents either the CPU or GPU. MLCDeviceTypeAny MLCDeviceType = 2 // A device type that represents the Apple Neural Engine. MLCDeviceTypeANE MLCDeviceType = 3 // A number that represents the number of device types. MLCDeviceTypeCount MLCDeviceType = 4 )
func (MLCDeviceType) String ¶
func (e MLCDeviceType) String() string
type MLCDropoutLayer ¶
type MLCDropoutLayer struct {
MLCLayer
}
A layer that deactivates neurons randomly to avoid overfitting.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcdropoutlayer
func MLCDropoutLayerFromID ¶
func MLCDropoutLayerFromID(id objc.ID) *MLCDropoutLayer
func MLCDropoutLayerLayerWithRateSeed ¶
func MLCDropoutLayerLayerWithRateSeed(rate float32, seed uint) *MLCDropoutLayer
Creates a dropout layer with the probability rate and random number generator seed you specify.
func (*MLCDropoutLayer) Rate ¶
func (o *MLCDropoutLayer) Rate() float32
@property rate @abstract The probability that each element is dropped
func (*MLCDropoutLayer) Seed ¶
func (o *MLCDropoutLayer) Seed() uint
@property seed @abstract The initial seed used to generate random numbers
type MLCEmbeddingDescriptor ¶
type MLCEmbeddingDescriptor struct {
foundation.NSObject
}
A configuration object you use to create an embedding layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcembeddingdescriptor
func MLCEmbeddingDescriptorDescriptorWithEmbeddingCountEmbeddingDimension ¶
func MLCEmbeddingDescriptorDescriptorWithEmbeddingCountEmbeddingDimension(embeddingCount *foundation.NSNumber, embeddingDimension *foundation.NSNumber) *MLCEmbeddingDescriptor
Creates an embedding descriptor with the size of the dictionary and dimension of embedding vectors you specify.
func MLCEmbeddingDescriptorDescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency ¶
func MLCEmbeddingDescriptorDescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency(embeddingCount *foundation.NSNumber, embeddingDimension *foundation.NSNumber, paddingIndex *foundation.NSNumber, maximumNorm *foundation.NSNumber, pNorm *foundation.NSNumber, scalesGradientByFrequency bool) *MLCEmbeddingDescriptor
Creates a new embedding descriptor with the size and dimension of embedding vectors, padding index, and norm and scaling options that you specify.
func MLCEmbeddingDescriptorFromID ¶
func MLCEmbeddingDescriptorFromID(id objc.ID) *MLCEmbeddingDescriptor
func (*MLCEmbeddingDescriptor) EmbeddingCount ¶
func (o *MLCEmbeddingDescriptor) EmbeddingCount() *foundation.NSNumber
@property embeddingCount @abstract The size of the dictionary
func (*MLCEmbeddingDescriptor) EmbeddingDimension ¶
func (o *MLCEmbeddingDescriptor) EmbeddingDimension() *foundation.NSNumber
@property embeddingDimension @abstract The dimension of embedding vectors
func (*MLCEmbeddingDescriptor) MaximumNorm ¶
func (o *MLCEmbeddingDescriptor) MaximumNorm() *foundation.NSNumber
@property maximumNorm @abstract A float, if set, in the forward pass only, the selected embedding vectors will be re-normalized to have an Lp norm of less than maximumNorm in the dictionary, Default=nil
func (*MLCEmbeddingDescriptor) PNorm ¶
func (o *MLCEmbeddingDescriptor) PNorm() *foundation.NSNumber
@property pNorm @abstract A float, the p of the Lp norm, can be set to infinity norm by [NSNumber numberWithFloat:INFINITY]. Default=2.0
func (*MLCEmbeddingDescriptor) PaddingIndex ¶
func (o *MLCEmbeddingDescriptor) PaddingIndex() *foundation.NSNumber
@property paddingIndex @abstract If set, the embedding vector at paddingIndex is initialized with zero and will not be updated in gradient pass, Default=nil
func (*MLCEmbeddingDescriptor) ScalesGradientByFrequency ¶
func (o *MLCEmbeddingDescriptor) ScalesGradientByFrequency() bool
@property scalesGradientByFrequency @abstract If set, the gradients are scaled by the inverse of the frequency of the words in batch before the weight update. Default=NO
type MLCEmbeddingLayer ¶
type MLCEmbeddingLayer struct {
MLCLayer
}
A layer that stores a word embedding.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcembeddinglayer
func MLCEmbeddingLayerFromID ¶
func MLCEmbeddingLayerFromID(id objc.ID) *MLCEmbeddingLayer
func MLCEmbeddingLayerLayerWithDescriptorWeights ¶
func MLCEmbeddingLayerLayerWithDescriptorWeights(descriptor *MLCEmbeddingDescriptor, weights *MLCTensor) *MLCEmbeddingLayer
Creates an embedding layer with the descriptor and word embedding weights tensor you specify.
func (*MLCEmbeddingLayer) Descriptor ¶
func (o *MLCEmbeddingLayer) Descriptor() *MLCEmbeddingDescriptor
func (*MLCEmbeddingLayer) Weights ¶
func (o *MLCEmbeddingLayer) Weights() *MLCTensor
@property weights @abstract The array of word embeddings
func (*MLCEmbeddingLayer) WeightsParameter ¶
func (o *MLCEmbeddingLayer) WeightsParameter() *MLCTensorParameter
@property weightsParameter @abstract The weights tensor parameter used for optimizer update
type MLCExecutionOptions ¶
type MLCExecutionOptions int64
A bitmask that specifies the options you use when executing a graph.
const ( // The option to execute the graph in the most efficient way possible. MLCExecutionOptionsNone MLCExecutionOptions = 0 // The option to skip writing input data to device memory. MLCExecutionOptionsSkipWritingInputDataToDevice MLCExecutionOptions = 1 // The option to execute the graph synchronously. MLCExecutionOptionsSynchronous MLCExecutionOptions = 2 // The option to return profiling information in the callback before returning from execution. MLCExecutionOptionsProfiling MLCExecutionOptions = 4 // The option to execute the forward pass for inference only. MLCExecutionOptionsForwardForInference MLCExecutionOptions = 8 // The option to enable additional per-layer profiling information using signposts. MLCExecutionOptionsPerLayerProfiling MLCExecutionOptions = 16 )
func (MLCExecutionOptions) String ¶
func (e MLCExecutionOptions) String() string
type MLCFullyConnectedLayer ¶
type MLCFullyConnectedLayer struct {
MLCLayer
}
A layer that connects each input to each output within its layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcfullyconnectedlayer
func MLCFullyConnectedLayerFromID ¶
func MLCFullyConnectedLayerFromID(id objc.ID) *MLCFullyConnectedLayer
func MLCFullyConnectedLayerLayerWithWeightsBiasesDescriptor ¶
func MLCFullyConnectedLayerLayerWithWeightsBiasesDescriptor(weights *MLCTensor, biases *MLCTensor, descriptor *MLCConvolutionDescriptor) *MLCFullyConnectedLayer
Creates a fully connected layer with the weights, biases, and convolution descriptor you specify.
func (*MLCFullyConnectedLayer) Biases ¶
func (o *MLCFullyConnectedLayer) Biases() *MLCTensor
@property biases @abstract The bias tensor used by the convolution layer
func (*MLCFullyConnectedLayer) BiasesParameter ¶
func (o *MLCFullyConnectedLayer) BiasesParameter() *MLCTensorParameter
@property biasesParameter @abstract The bias tensor parameter used for optimizer update
func (*MLCFullyConnectedLayer) Descriptor ¶
func (o *MLCFullyConnectedLayer) Descriptor() *MLCConvolutionDescriptor
@property descriptor @abstract The convolution descriptor
func (*MLCFullyConnectedLayer) Weights ¶
func (o *MLCFullyConnectedLayer) Weights() *MLCTensor
@property weights @abstract The weights tensor used by the convolution layer
func (*MLCFullyConnectedLayer) WeightsParameter ¶
func (o *MLCFullyConnectedLayer) WeightsParameter() *MLCTensorParameter
@property weightsParameter @abstract The weights tensor parameter used for optimizer update
type MLCGatherLayer ¶
type MLCGatherLayer struct {
MLCLayer
}
A layer that fetches data at the locations you specify.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcgatherlayer
func MLCGatherLayerFromID ¶
func MLCGatherLayerFromID(id objc.ID) *MLCGatherLayer
func MLCGatherLayerLayerWithDimension ¶
func MLCGatherLayerLayerWithDimension(dimension uint) *MLCGatherLayer
Creates a gather layer with the dimension you specify.
func (*MLCGatherLayer) Dimension ¶
func (o *MLCGatherLayer) Dimension() uint
@property dimension @abstract The dimension along which to index
type MLCGradientClippingType ¶
type MLCGradientClippingType int64
A clipping type the system applies to a gradient.
const ( // An option that clips by value. MLCGradientClippingTypeByValue MLCGradientClippingType = 0 // An option that clips by norm. MLCGradientClippingTypeByNorm MLCGradientClippingType = 1 // An option that clips by global norm. MLCGradientClippingTypeByGlobalNorm MLCGradientClippingType = 2 )
func (MLCGradientClippingType) String ¶
func (e MLCGradientClippingType) String() string
type MLCGramMatrixLayer ¶
type MLCGramMatrixLayer struct {
MLCLayer
}
A layer that computes the uncentered cross-correlation values between the spacial planes of each feature channel of a tensor.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcgrammatrixlayer
func MLCGramMatrixLayerFromID ¶
func MLCGramMatrixLayerFromID(id objc.ID) *MLCGramMatrixLayer
func MLCGramMatrixLayerLayerWithScale ¶
func MLCGramMatrixLayerLayerWithScale(scale float32) *MLCGramMatrixLayer
Creates a gram matrix layer with the scaling factor you specify.
func (*MLCGramMatrixLayer) Scale ¶
func (o *MLCGramMatrixLayer) Scale() float32
@property scale @abstract The scale factor
type MLCGraph ¶
type MLCGraph struct {
foundation.NSObject
}
A graph of layers you use to build a training or inference graph.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcgraph
func MLCGraphFromID ¶
func (*MLCGraph) BindAndWriteDataForInputsToDeviceBatchSizeSynchronous ¶
func (o *MLCGraph) BindAndWriteDataForInputsToDeviceBatchSizeSynchronous(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], inputTensors *foundation.NSDictionary[*foundation.NSString, *MLCTensor], device *MLCDevice, batchSize uint, synchronous bool) bool
Associates the given data with the input tensors, and if the device is a GPU, also copies the data to the device memory.
func (*MLCGraph) BindAndWriteDataForInputsToDeviceSynchronous ¶
func (o *MLCGraph) BindAndWriteDataForInputsToDeviceSynchronous(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], inputTensors *foundation.NSDictionary[*foundation.NSString, *MLCTensor], device *MLCDevice, synchronous bool) bool
Associates the given data with the input tensors, and if the device is a GPU, also copies the data to the device memory.
func (*MLCGraph) ConcatenateWithSourcesDimension ¶
func (o *MLCGraph) ConcatenateWithSourcesDimension(sources *foundation.NSArray[*MLCTensor], dimension uint) *MLCTensor
Adds a new concatenation layer to the graph using the source tensors and concatenation dimension you specify.
func (*MLCGraph) GatherWithDimensionSourceIndices ¶
func (o *MLCGraph) GatherWithDimensionSourceIndices(dimension uint, source *MLCTensor, indices *MLCTensor) *MLCTensor
Adds a gather layer to the graph using the source tensor, dimension along which to index, and the indices you specify.
func (*MLCGraph) Layers ¶
func (o *MLCGraph) Layers() *foundation.NSArray[*MLCLayer]
@abstract Layers in the graph
func (*MLCGraph) NodeWithLayerSource ¶
Adds the layer and source tensor that you specify to the graph.
func (*MLCGraph) NodeWithLayerSources ¶
func (o *MLCGraph) NodeWithLayerSources(layer *MLCLayer, sources *foundation.NSArray[*MLCTensor]) *MLCTensor
Adds the layer and source tensors that you specify to the graph.
func (*MLCGraph) NodeWithLayerSourcesDisableUpdate ¶
func (o *MLCGraph) NodeWithLayerSourcesDisableUpdate(layer *MLCLayer, sources *foundation.NSArray[*MLCTensor], disableUpdate bool) *MLCTensor
Adds the layer, source tensors, and option to disable optimizer updates that you specify to the graph.
func (*MLCGraph) NodeWithLayerSourcesLossLabels ¶
func (o *MLCGraph) NodeWithLayerSourcesLossLabels(layer *MLCLayer, sources *foundation.NSArray[*MLCTensor], lossLabels *foundation.NSArray[*MLCTensor]) *MLCTensor
Adds the layer, sources, and loss labels tensors that you specify to the graph.
func (*MLCGraph) ReshapeWithShapeSource ¶
func (o *MLCGraph) ReshapeWithShapeSource(shape *foundation.NSArray[*foundation.NSNumber], source *MLCTensor) *MLCTensor
Adds a new reshape layer to the graph using the shape and source tensor you specify.
func (*MLCGraph) ResultTensorsForLayer ¶
func (o *MLCGraph) ResultTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
Gets the result tensors for a layer in the training graph.
func (*MLCGraph) ScatterWithDimensionSourceIndicesCopyFromReductionType ¶
func (o *MLCGraph) ScatterWithDimensionSourceIndicesCopyFromReductionType(dimension uint, source *MLCTensor, indices *MLCTensor, copyFrom *MLCTensor, reductionType MLCReductionType) *MLCTensor
Adds a scatter layer to the graph.
func (*MLCGraph) SelectWithSourcesCondition ¶
func (o *MLCGraph) SelectWithSourcesCondition(sources *foundation.NSArray[*MLCTensor], condition *MLCTensor) *MLCTensor
Adds a select layer to the graph using the condition mask and source tensors you specify.
func (*MLCGraph) SourceTensorsForLayer ¶
func (o *MLCGraph) SourceTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
Gets the source tensors for a layer in the training graph.
func (*MLCGraph) SplitWithSourceSplitCountDimension ¶
func (o *MLCGraph) SplitWithSourceSplitCountDimension(source *MLCTensor, splitCount uint, dimension uint) *foundation.NSArray[*MLCTensor]
Adds a new split layer to the graph using the source tensor, number of splits, and dimension to split the source tensor that you specify.
func (*MLCGraph) SplitWithSourceSplitSectionLengthsDimension ¶
func (o *MLCGraph) SplitWithSourceSplitSectionLengthsDimension(source *MLCTensor, splitSectionLengths *foundation.NSArray[*foundation.NSNumber], dimension uint) *foundation.NSArray[*MLCTensor]
Adds a new split layer to the graph using the source tensor, lengths of each split section, and dimension to split the source tensor that you specify.
func (*MLCGraph) SummarizedDOTDescription ¶
func (o *MLCGraph) SummarizedDOTDescription() *foundation.NSString
@abstract A DOT representation of the graph. @discussion For more info on the DOT language, refer to https://en.wikipedia.org/wiki/DOT_(graph_description_language). Edges that have a dashed lines are those that have stop gradients, while those with solid lines don't.
func (*MLCGraph) TransposeWithDimensionsSource ¶
func (o *MLCGraph) TransposeWithDimensionsSource(dimensions *foundation.NSArray[*foundation.NSNumber], source *MLCTensor) *MLCTensor
Adds a new transpose layer to the graph using the dimensions and source tensor you specify.
type MLCGraphCompilationOptions ¶
type MLCGraphCompilationOptions int64
A bitmask that specifies the options you use when compiling a graph.
const ( // The default option for graph compilation. MLCGraphCompilationOptionsNone MLCGraphCompilationOptions = 0 // The option to debug layers during graph compilation. MLCGraphCompilationOptionsDebugLayers MLCGraphCompilationOptions = 1 // The option to disable layer fusion during graph compilation. MLCGraphCompilationOptionsDisableLayerFusion MLCGraphCompilationOptions = 2 // The option to link graphs during graph compilation. MLCGraphCompilationOptionsLinkGraphs MLCGraphCompilationOptions = 4 // The option to compute all gradients during graph compilation. MLCGraphCompilationOptionsComputeAllGradients MLCGraphCompilationOptions = 8 )
func (MLCGraphCompilationOptions) String ¶
func (e MLCGraphCompilationOptions) String() string
type MLCGroupNormalizationLayer ¶
type MLCGroupNormalizationLayer struct {
MLCLayer
}
A layer that divides the channels into groups for normalization.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcgroupnormalizationlayer
func MLCGroupNormalizationLayerFromID ¶
func MLCGroupNormalizationLayerFromID(id objc.ID) *MLCGroupNormalizationLayer
func MLCGroupNormalizationLayerLayerWithFeatureChannelCountGroupCountBetaGammaVarianceEpsilon ¶
func MLCGroupNormalizationLayerLayerWithFeatureChannelCountGroupCountBetaGammaVarianceEpsilon(featureChannelCount uint, groupCount uint, beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32) *MLCGroupNormalizationLayer
Creates a group normalization layer with the number of feature channels and groups, beta and gamma tensors, and variance epsilon you specify.
func (*MLCGroupNormalizationLayer) Beta ¶
func (o *MLCGroupNormalizationLayer) Beta() *MLCTensor
@property beta @abstract The beta tensor
func (*MLCGroupNormalizationLayer) BetaParameter ¶
func (o *MLCGroupNormalizationLayer) BetaParameter() *MLCTensorParameter
@property betaParameter @abstract The beta tensor parameter used for optimizer update
func (*MLCGroupNormalizationLayer) FeatureChannelCount ¶
func (o *MLCGroupNormalizationLayer) FeatureChannelCount() uint
@property featureChannelCount @abstract The number of feature channels
func (*MLCGroupNormalizationLayer) Gamma ¶
func (o *MLCGroupNormalizationLayer) Gamma() *MLCTensor
@property gamma @abstract The gamma tensor
func (*MLCGroupNormalizationLayer) GammaParameter ¶
func (o *MLCGroupNormalizationLayer) GammaParameter() *MLCTensorParameter
@property gammaParameter @abstract The gamma tensor parameter used for optimizer update
func (*MLCGroupNormalizationLayer) GroupCount ¶
func (o *MLCGroupNormalizationLayer) GroupCount() uint
@property groupCount @abstract The number of groups to separate the channels into
func (*MLCGroupNormalizationLayer) VarianceEpsilon ¶
func (o *MLCGroupNormalizationLayer) VarianceEpsilon() float32
@property varianceEpsilon @abstract A value used for numerical stability
type MLCInferenceGraph ¶
type MLCInferenceGraph struct {
MLCGraph
}
An inference graph created from one or more MLCGraph instances plus additional layers added directly to the inference graph.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcinferencegraph
func MLCInferenceGraphFromID ¶
func MLCInferenceGraphFromID(id objc.ID) *MLCInferenceGraph
func MLCInferenceGraphGraphWithGraphObjects ¶
func MLCInferenceGraphGraphWithGraphObjects(graphObjects *foundation.NSArray[*MLCGraph]) *MLCInferenceGraph
Creates an inference graph with the layers from the graph objects you specify.
func (*MLCInferenceGraph) AddInputs ¶
func (o *MLCInferenceGraph) AddInputs(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
Adds the inputs you specify to the inference graph.
func (*MLCInferenceGraph) AddInputsLossLabelsLossLabelWeights ¶
func (o *MLCInferenceGraph) AddInputsLossLabelsLossLabelWeights(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor], lossLabels *foundation.NSDictionary[*foundation.NSString, *MLCTensor], lossLabelWeights *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
Adds the inputs, loss labels, and loss label weights that you specify to the inference graph.
func (*MLCInferenceGraph) AddOutputs ¶
func (o *MLCInferenceGraph) AddOutputs(outputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
Adds the outputs you specify to the inference graph.
func (*MLCInferenceGraph) CompileWithOptionsDevice ¶
func (o *MLCInferenceGraph) CompileWithOptionsDevice(options MLCGraphCompilationOptions, device *MLCDevice) bool
Compiles the inference graph for the options and device you specify.
func (*MLCInferenceGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData ¶
func (o *MLCInferenceGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options MLCGraphCompilationOptions, device *MLCDevice, inputTensors *foundation.NSDictionary[*foundation.NSString, *MLCTensor], inputTensorsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData]) bool
Compiles the inference graph for the options, device, and input tensors you specify.
func (*MLCInferenceGraph) DeviceMemorySize ¶
func (o *MLCInferenceGraph) DeviceMemorySize() uint
@property The device memory size used by the inference graph @abstract Returns the total size in bytes of device memory used by all intermediate tensors in the inference graph @return A NSUInteger value
func (*MLCInferenceGraph) ExecuteWithInputsDataBatchSizeOptionsCompletionHandler ¶
func (o *MLCInferenceGraph) ExecuteWithInputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the inference graph with the inputs data, batch size, execution options, and completion handler you specify.
func (*MLCInferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler ¶
func (o *MLCInferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelWeightsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the inference graph with the input data, batch size, execution options and completion handler you specify.
func (*MLCInferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler ¶
func (o *MLCInferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelWeightsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], outputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the inference graph with the input and output data, batch size, execution options, and completion handler that you specify.
func (*MLCInferenceGraph) ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler ¶
func (o *MLCInferenceGraph) ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], outputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the inference graph with the inputs and outputs data, batch size, execution options, and completion handler that you specify.
func (*MLCInferenceGraph) LinkWithGraphs ¶
func (o *MLCInferenceGraph) LinkWithGraphs(graphs *foundation.NSArray[*MLCInferenceGraph]) bool
Links the inference graphs you specify.
type MLCInstanceNormalizationLayer ¶
type MLCInstanceNormalizationLayer struct {
MLCLayer
}
A layer that normalizes all features of one channel.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcinstancenormalizationlayer
func MLCInstanceNormalizationLayerFromID ¶
func MLCInstanceNormalizationLayerFromID(id objc.ID) *MLCInstanceNormalizationLayer
func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountBetaGammaVarianceEpsilon ¶
func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountBetaGammaVarianceEpsilon(featureChannelCount uint, beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32) *MLCInstanceNormalizationLayer
Creates an instance normalization layer with the number of feature channels, beta and gamma tensors, and variance epsilon you specify.
func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum ¶
func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum(featureChannelCount uint, beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32, momentum float32) *MLCInstanceNormalizationLayer
Creates an instance normalization layer with the number of feature channels, beta and gamma tensors, variance epsilon, and momentum you specify.
func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum ¶
func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount uint, mean *MLCTensor, variance *MLCTensor, beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32, momentum float32) *MLCInstanceNormalizationLayer
Creates an instance normalization layer with the number of feature channels, mean, variance, beta and gamma tensors, variance epsilon, and momentum you specify.
func (*MLCInstanceNormalizationLayer) Beta ¶
func (o *MLCInstanceNormalizationLayer) Beta() *MLCTensor
@property beta @abstract The beta tensor
func (*MLCInstanceNormalizationLayer) BetaParameter ¶
func (o *MLCInstanceNormalizationLayer) BetaParameter() *MLCTensorParameter
@property betaParameter @abstract The beta tensor parameter used for optimizer update
func (*MLCInstanceNormalizationLayer) FeatureChannelCount ¶
func (o *MLCInstanceNormalizationLayer) FeatureChannelCount() uint
@property featureChannelCount @abstract The number of feature channels
func (*MLCInstanceNormalizationLayer) Gamma ¶
func (o *MLCInstanceNormalizationLayer) Gamma() *MLCTensor
@property gamma @abstract The gamma tensor
func (*MLCInstanceNormalizationLayer) GammaParameter ¶
func (o *MLCInstanceNormalizationLayer) GammaParameter() *MLCTensorParameter
@property gammaParameter @abstract The gamma tensor parameter used for optimizer update
func (*MLCInstanceNormalizationLayer) Mean ¶
func (o *MLCInstanceNormalizationLayer) Mean() *MLCTensor
@property mean @abstract The running mean tensor
func (*MLCInstanceNormalizationLayer) Momentum ¶
func (o *MLCInstanceNormalizationLayer) Momentum() float32
@property momentum @abstract The value used for the running mean and variance computation @discussion The default is 0.99f.
func (*MLCInstanceNormalizationLayer) Variance ¶
func (o *MLCInstanceNormalizationLayer) Variance() *MLCTensor
@property variance @abstract The running variance tensor
func (*MLCInstanceNormalizationLayer) VarianceEpsilon ¶
func (o *MLCInstanceNormalizationLayer) VarianceEpsilon() float32
@property varianceEpsilon @abstract A value used for numerical stability
type MLCLSTMDescriptor ¶
type MLCLSTMDescriptor struct {
foundation.NSObject
}
The configuration object you use to create the LSTM layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlclstmdescriptor
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCount ¶
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCount(inputSize uint, hiddenSize uint, layerCount uint) *MLCLSTMDescriptor
Creates a batch first LSTM descriptor with the input size and number of layers you specify.
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout ¶
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, batchFirst bool, isBidirectional bool, dropout float32) *MLCLSTMDescriptor
Creates a batch first LSTM descriptor that allows you to indicate whether the input and output shape is batch first.
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout ¶
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, batchFirst bool, isBidirectional bool, returnsSequences bool, dropout float32) *MLCLSTMDescriptor
Creates a batch first LSTM descriptor that allows you to indicate whether the layer returns output for all sequences, or output for only the last sequence.
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode ¶
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, batchFirst bool, isBidirectional bool, returnsSequences bool, dropout float32, resultMode MLCLSTMResultMode) *MLCLSTMDescriptor
Creates a descriptor with the number of features and layers, dropout, and options for use of biases, batch order, return sequences, bidirectionality, and expected tensors you specify.
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout ¶
func MLCLSTMDescriptorDescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout(inputSize uint, hiddenSize uint, layerCount uint, usesBiases bool, isBidirectional bool, dropout float32) *MLCLSTMDescriptor
Creates a batch first LSTM descriptor with bias and bidirectional options you specify.
func MLCLSTMDescriptorFromID ¶
func MLCLSTMDescriptorFromID(id objc.ID) *MLCLSTMDescriptor
func (*MLCLSTMDescriptor) BatchFirst ¶
func (o *MLCLSTMDescriptor) BatchFirst() bool
@property batchFirst @abstract LSTM only supports batchFirst=YES. This means the input and output will have shape [batch size, time steps, feature]. Default is YES.
func (*MLCLSTMDescriptor) Dropout ¶
func (o *MLCLSTMDescriptor) Dropout() float32
@property dropout @abstract If non-zero, intrdouces a dropout layer on the outputs of each LSTM layer except the last layer, with dropout probablity equal to dropout. Default is 0.0.
func (*MLCLSTMDescriptor) HiddenSize ¶
func (o *MLCLSTMDescriptor) HiddenSize() uint
@property hiddenSize @abstract The number of feature channels in the hidden state
func (*MLCLSTMDescriptor) InputSize ¶
func (o *MLCLSTMDescriptor) InputSize() uint
@property inputSize @abstract The number of expected feature channels in the input
func (*MLCLSTMDescriptor) IsBidirectional ¶
func (o *MLCLSTMDescriptor) IsBidirectional() bool
@property isBidirectional @abstract If YES, becomes a bidirectional LSTM. Default is NO.
func (*MLCLSTMDescriptor) LayerCount ¶
func (o *MLCLSTMDescriptor) LayerCount() uint
@property layerCount @abstract The number of recurrent layers. Default is 1.
func (*MLCLSTMDescriptor) ResultMode ¶
func (o *MLCLSTMDescriptor) ResultMode() MLCLSTMResultMode
@property resultMode @abstract MLCLSTMResultModeOutput returns output data. MLCLSTMResultModeOutputAndStates returns output data, last hidden state h_n, and last cell state c_n. Default MLCLSTMResultModeOutput.
func (*MLCLSTMDescriptor) ReturnsSequences ¶
func (o *MLCLSTMDescriptor) ReturnsSequences() bool
@property returnsSequences @abstract if YES return output for all sequences else return output only for the last sequences. Default: YES
func (*MLCLSTMDescriptor) UsesBiases ¶
func (o *MLCLSTMDescriptor) UsesBiases() bool
@property usesBiases @abstract If NO, the layer does not use bias terms. Default is YES.
type MLCLSTMLayer ¶
type MLCLSTMLayer struct {
MLCLayer
}
A layer that represents long short-term memory (LSTM) networks.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlclstmlayer
func MLCLSTMLayerFromID ¶
func MLCLSTMLayerFromID(id objc.ID) *MLCLSTMLayer
func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsBiases ¶
func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsBiases(descriptor *MLCLSTMDescriptor, inputWeights *foundation.NSArray[*MLCTensor], hiddenWeights *foundation.NSArray[*MLCTensor], biases *foundation.NSArray[*MLCTensor]) *MLCLSTMLayer
Creates an LSTM layer with the descriptor, input and hidden weights, and biases you specify.
func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases ¶
func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases(descriptor *MLCLSTMDescriptor, inputWeights *foundation.NSArray[*MLCTensor], hiddenWeights *foundation.NSArray[*MLCTensor], peepholeWeights *foundation.NSArray[*MLCTensor], biases *foundation.NSArray[*MLCTensor]) *MLCLSTMLayer
Creates an LSTM layer with the descriptor, weights, and biases you specify.
func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation ¶
func MLCLSTMLayerLayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation(descriptor *MLCLSTMDescriptor, inputWeights *foundation.NSArray[*MLCTensor], hiddenWeights *foundation.NSArray[*MLCTensor], peepholeWeights *foundation.NSArray[*MLCTensor], biases *foundation.NSArray[*MLCTensor], gateActivations *foundation.NSArray[*MLCActivationDescriptor], outputResultActivation *MLCActivationDescriptor) *MLCLSTMLayer
Creates an LSTM layer using the descriptor, weights, biases, gate activations, and output result activation that you specify.
func (*MLCLSTMLayer) Biases ¶
func (o *MLCLSTMLayer) Biases() *foundation.NSArray[*MLCTensor]
@property biases @abstract The array of tensors describing the bias terms for the input, hidden, cell and output gates
func (*MLCLSTMLayer) BiasesParameters ¶
func (o *MLCLSTMLayer) BiasesParameters() *foundation.NSArray[*MLCTensorParameter]
@property biasesParameters @abstract The bias tensor parameter used for optimizer update
func (*MLCLSTMLayer) Descriptor ¶
func (o *MLCLSTMLayer) Descriptor() *MLCLSTMDescriptor
@property descriptor @abstract The LSTM descriptor
func (*MLCLSTMLayer) GateActivations ¶
func (o *MLCLSTMLayer) GateActivations() *foundation.NSArray[*MLCActivationDescriptor]
@property gateActivations @abstract The array of gate activations for input, hidden, cell and output gates @discussion The default gate activations are: sigmoid, sigmoid, tanh, sigmoid
func (*MLCLSTMLayer) HiddenWeights ¶
func (o *MLCLSTMLayer) HiddenWeights() *foundation.NSArray[*MLCTensor]
@property hiddenWeights @abstract The array of tensors describing the hidden weights for the input, hidden, cell and output gates
func (*MLCLSTMLayer) HiddenWeightsParameters ¶
func (o *MLCLSTMLayer) HiddenWeightsParameters() *foundation.NSArray[*MLCTensorParameter]
@property hiddenWeightsParameters @abstract The hidden weights tensor parameters used for optimizer update
func (*MLCLSTMLayer) InputWeights ¶
func (o *MLCLSTMLayer) InputWeights() *foundation.NSArray[*MLCTensor]
@property inputWeights @abstract The array of tensors describing the input weights for the input, hidden, cell and output gates
func (*MLCLSTMLayer) InputWeightsParameters ¶
func (o *MLCLSTMLayer) InputWeightsParameters() *foundation.NSArray[*MLCTensorParameter]
@property inputWeightsParameters @abstract The input weights tensor parameters used for optimizer update
func (*MLCLSTMLayer) OutputResultActivation ¶
func (o *MLCLSTMLayer) OutputResultActivation() *MLCActivationDescriptor
@property outputResultActivation @abstract The output activation descriptor
func (*MLCLSTMLayer) PeepholeWeights ¶
func (o *MLCLSTMLayer) PeepholeWeights() *foundation.NSArray[*MLCTensor]
@property peepholeWeights @abstract The array of tensors describing the peephole weights for the input, hidden, cell and output gates
func (*MLCLSTMLayer) PeepholeWeightsParameters ¶
func (o *MLCLSTMLayer) PeepholeWeightsParameters() *foundation.NSArray[*MLCTensorParameter]
@property peepholeWeightsParameters @abstract The peephole weights tensor parameters used for optimizer update
type MLCLSTMResultMode ¶
type MLCLSTMResultMode int64
Constants that describe the result of an LSTM layer.
const ( // A result mode that indicates the layer produces a single result tensor that represents the final output of the LSTM. MLCLSTMResultModeOutput MLCLSTMResultMode = 0 // A result mode that indicates the layer produces three result tensors that represent the final output of the LSTM, the last hidden state, and the cell state. MLCLSTMResultModeOutputAndStates MLCLSTMResultMode = 1 )
func (MLCLSTMResultMode) String ¶
func (e MLCLSTMResultMode) String() string
type MLCLayer ¶
type MLCLayer struct {
foundation.NSObject
}
The base class for all framework layers.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlclayer
func MLCLayerFromID ¶
func (*MLCLayer) DeviceType ¶
func (o *MLCLayer) DeviceType() MLCDeviceType
@property deviceType @abstract The device type where this layer will be executed @discussion Typically the MLCDevice passed to compileWithOptions will be the device used to execute layers in the graph. If MLCDeviceTypeANE is selected, it is possible that some of the layers of the graph may not be executed on the ANE but instead on the CPU or GPU. This property can be used to determine which device type the layer will be executed on.
func (*MLCLayer) IsDebuggingEnabled ¶
@property isDebuggingEnabled @abstract A flag to identify if we want to debug this layer when executing a graph that includes this layer @discussion If this is set, we will make sure that the result tensor and gradient tensors are available for reading on CPU The default is NO. If isDebuggingEnabled is set to YES, make sure to set options to enable debugging when compiling the graph. Otherwise this property may be ignored.
func (*MLCLayer) Label ¶
func (o *MLCLayer) Label() *foundation.NSString
@property label @abstract A string to help identify this object.
func (*MLCLayer) LayerID ¶
@property layerID @abstract The layer ID @discussion A unique number to identify each layer. Assigned when the layer is created.
func (*MLCLayer) SetIsDebuggingEnabled ¶
func (*MLCLayer) SetLabel ¶
func (o *MLCLayer) SetLabel(label *foundation.NSString)
type MLCLayerNormalizationLayer ¶
type MLCLayerNormalizationLayer struct {
MLCLayer
}
A layer that applies layer normalization over inputs.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlclayernormalizationlayer
func MLCLayerNormalizationLayerFromID ¶
func MLCLayerNormalizationLayerFromID(id objc.ID) *MLCLayerNormalizationLayer
func MLCLayerNormalizationLayerLayerWithNormalizedShapeBetaGammaVarianceEpsilon ¶
func MLCLayerNormalizationLayerLayerWithNormalizedShapeBetaGammaVarianceEpsilon(normalizedShape *foundation.NSArray[*foundation.NSNumber], beta *MLCTensor, gamma *MLCTensor, varianceEpsilon float32) *MLCLayerNormalizationLayer
Creates a normalization layer with a shape, beta and gamma tensors, and variance epsilon you specify.
func (*MLCLayerNormalizationLayer) Beta ¶
func (o *MLCLayerNormalizationLayer) Beta() *MLCTensor
@property beta @abstract The beta tensor
func (*MLCLayerNormalizationLayer) BetaParameter ¶
func (o *MLCLayerNormalizationLayer) BetaParameter() *MLCTensorParameter
@property betaParameter @abstract The beta tensor parameter used for optimizer update
func (*MLCLayerNormalizationLayer) Gamma ¶
func (o *MLCLayerNormalizationLayer) Gamma() *MLCTensor
@property gamma @abstract The gamma tensor
func (*MLCLayerNormalizationLayer) GammaParameter ¶
func (o *MLCLayerNormalizationLayer) GammaParameter() *MLCTensorParameter
@property gammaParameter @abstract The gamma tensor parameter used for optimizer update
func (*MLCLayerNormalizationLayer) NormalizedShape ¶
func (o *MLCLayerNormalizationLayer) NormalizedShape() *foundation.NSArray[*foundation.NSNumber]
@property normalizedShape @abstract The shape of the axes over which normalization occurs, (W), (H,W) or (C,H,W)
func (*MLCLayerNormalizationLayer) VarianceEpsilon ¶
func (o *MLCLayerNormalizationLayer) VarianceEpsilon() float32
@property varianceEpsilon @abstract A value used for numerical stability
type MLCLossDescriptor ¶
type MLCLossDescriptor struct {
foundation.NSObject
}
A configuration object you use to create a loss layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlclossdescriptor
func MLCLossDescriptorDescriptorWithTypeReductionType ¶
func MLCLossDescriptorDescriptorWithTypeReductionType(lossType MLCLossType, reductionType MLCReductionType) *MLCLossDescriptor
Creates a loss descriptor with the loss function and reduction type you specify.
func MLCLossDescriptorDescriptorWithTypeReductionTypeWeight ¶
func MLCLossDescriptorDescriptorWithTypeReductionTypeWeight(lossType MLCLossType, reductionType MLCReductionType, weight float32) *MLCLossDescriptor
Creates a loss descriptor with the loss function, reduction type, and weight you specify.
func MLCLossDescriptorDescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount ¶
func MLCLossDescriptorDescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount(lossType MLCLossType, reductionType MLCReductionType, weight float32, labelSmoothing float32, classCount uint) *MLCLossDescriptor
Creates a loss descriptor with the loss function, reduction type, weight, label smoothing, and number of classes you specify.
func MLCLossDescriptorDescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta ¶
func MLCLossDescriptorDescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta(lossType MLCLossType, reductionType MLCReductionType, weight float32, labelSmoothing float32, classCount uint, epsilon float32, delta float32) *MLCLossDescriptor
Creates a loss descriptor with the loss function, reduction type, weight, label smoothing, and number of classes, epsilon, and delta that you specify.
func MLCLossDescriptorFromID ¶
func MLCLossDescriptorFromID(id objc.ID) *MLCLossDescriptor
func (*MLCLossDescriptor) ClassCount ¶
func (o *MLCLossDescriptor) ClassCount() uint
@property numberOfClasses @abstract The number of classes parameter. The default value is 1. @discussion This parameter is valid only for the loss function MLCLossTypeSoftmaxCrossEntropy.
func (*MLCLossDescriptor) Delta ¶
func (o *MLCLossDescriptor) Delta() float32
@property delta @abstract The delta parameter. The default value is 1.0f. @discussion This parameter is valid only for the loss function MLCLossTypeHuber.
func (*MLCLossDescriptor) Epsilon ¶
func (o *MLCLossDescriptor) Epsilon() float32
@property epsilon @abstract The epsilon parameter. The default value is 1e-7. @discussion This parameter is valid only for the loss function MLCLossTypeLog.
func (*MLCLossDescriptor) LabelSmoothing ¶
func (o *MLCLossDescriptor) LabelSmoothing() float32
@property labelSmoothing @abstract The label smoothing parameter. The default value is 0.0. @discussion This parameter is valid only for the loss functions of the following type(s): MLCLossTypeSoftmaxCrossEntropy and MLCLossTypeSigmoidCrossEntropy.
func (*MLCLossDescriptor) LossType ¶
func (o *MLCLossDescriptor) LossType() MLCLossType
@property lossType @abstract Specifies the loss function.
func (*MLCLossDescriptor) ReductionType ¶
func (o *MLCLossDescriptor) ReductionType() MLCReductionType
@property reductionType @abstract The reduction operation performed by the loss function.
func (*MLCLossDescriptor) Weight ¶
func (o *MLCLossDescriptor) Weight() float32
@property weight @abstract The scale factor to apply to each element of a result. The default value is 1.0.
type MLCLossLayer ¶
type MLCLossLayer struct {
MLCLayer
}
A layer that estimates the inaccuracies of the model to reduce the loss on the next evaluation.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlclosslayer
func MLCLossLayerCategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight ¶
func MLCLossLayerCategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType MLCReductionType, labelSmoothing float32, classCount uint, weight float32) *MLCLossLayer
Creates a categorical cross entropy loss layer with the reduction type, label smoothing, number of classes, and weight you specify.
func MLCLossLayerCategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights ¶
func MLCLossLayerCategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType MLCReductionType, labelSmoothing float32, classCount uint, weights *MLCTensor) *MLCLossLayer
Creates a categorical cross entropy loss layer with the reduction type, label smoothing, number of classes, and weights you specify.
func MLCLossLayerCosineDistanceLossWithReductionTypeWeight ¶
func MLCLossLayerCosineDistanceLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
Creates a cosine distance loss layer with the reduction type and weight you specify.
func MLCLossLayerCosineDistanceLossWithReductionTypeWeights ¶
func MLCLossLayerCosineDistanceLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
Creates a cosine distance loss layer with the reduction type and weights you specify.
func MLCLossLayerFromID ¶
func MLCLossLayerFromID(id objc.ID) *MLCLossLayer
func MLCLossLayerHingeLossWithReductionTypeWeight ¶
func MLCLossLayerHingeLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
Creates a hinge loss layer with the reduction type and weight you specify.
func MLCLossLayerHingeLossWithReductionTypeWeights ¶
func MLCLossLayerHingeLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
Creates a hinge loss layer with the reduction type and weights you specify.
func MLCLossLayerHuberLossWithReductionTypeDeltaWeight ¶
func MLCLossLayerHuberLossWithReductionTypeDeltaWeight(reductionType MLCReductionType, delta float32, weight float32) *MLCLossLayer
Creates a huber loss layer with the reduction type, delta, and weight you specify.
func MLCLossLayerHuberLossWithReductionTypeDeltaWeights ¶
func MLCLossLayerHuberLossWithReductionTypeDeltaWeights(reductionType MLCReductionType, delta float32, weights *MLCTensor) *MLCLossLayer
Creates a huber loss layer with the reduction type, delta, and weights you specify.
func MLCLossLayerLayerWithDescriptor ¶
func MLCLossLayerLayerWithDescriptor(lossDescriptor *MLCLossDescriptor) *MLCLossLayer
Creates a loss layer with the descriptor you specify.
func MLCLossLayerLayerWithDescriptorWeights ¶
func MLCLossLayerLayerWithDescriptorWeights(lossDescriptor *MLCLossDescriptor, weights *MLCTensor) *MLCLossLayer
Creates a loss layer with the descriptor and weights you specify.
func MLCLossLayerLogLossWithReductionTypeEpsilonWeight ¶
func MLCLossLayerLogLossWithReductionTypeEpsilonWeight(reductionType MLCReductionType, epsilon float32, weight float32) *MLCLossLayer
Creates a log loss layer with the reduction type, epsilon, and weight you specify.
func MLCLossLayerLogLossWithReductionTypeEpsilonWeights ¶
func MLCLossLayerLogLossWithReductionTypeEpsilonWeights(reductionType MLCReductionType, epsilon float32, weights *MLCTensor) *MLCLossLayer
Creates a log loss layer with the reduction type, epsilon, and weights you specify.
func MLCLossLayerMeanAbsoluteErrorLossWithReductionTypeWeight ¶
func MLCLossLayerMeanAbsoluteErrorLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
Creates a mean absolute loss layer with the reduction type and weight.
func MLCLossLayerMeanAbsoluteErrorLossWithReductionTypeWeights ¶
func MLCLossLayerMeanAbsoluteErrorLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
Creates a mean absolute loss layer with the reduction type and weights you specify.
func MLCLossLayerMeanSquaredErrorLossWithReductionTypeWeight ¶
func MLCLossLayerMeanSquaredErrorLossWithReductionTypeWeight(reductionType MLCReductionType, weight float32) *MLCLossLayer
Creates a mean squared loss layer with the reduction type and weight you specify.
func MLCLossLayerMeanSquaredErrorLossWithReductionTypeWeights ¶
func MLCLossLayerMeanSquaredErrorLossWithReductionTypeWeights(reductionType MLCReductionType, weights *MLCTensor) *MLCLossLayer
Creates a mean squared loss layer with the reduction type and weights you specify.
func MLCLossLayerSigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight ¶
func MLCLossLayerSigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight(reductionType MLCReductionType, labelSmoothing float32, weight float32) *MLCLossLayer
Creates a sigmoid cross entropy loss layer with the reduction type, label smoothing, and weight you specify.
func MLCLossLayerSigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights ¶
func MLCLossLayerSigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights(reductionType MLCReductionType, labelSmoothing float32, weights *MLCTensor) *MLCLossLayer
Creates a sigmoid cross entropy loss layer with the reduction type, label smoothing, and weights you specify.
func MLCLossLayerSoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight ¶
func MLCLossLayerSoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType MLCReductionType, labelSmoothing float32, classCount uint, weight float32) *MLCLossLayer
Creates a softmax cross entropy loss layer with the reduction type, label smoothing, number of classes, and weight you specify.
func MLCLossLayerSoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights ¶
func MLCLossLayerSoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType MLCReductionType, labelSmoothing float32, classCount uint, weights *MLCTensor) *MLCLossLayer
Creates a softmax cross entropy loss layer with the reduction type, label smoothing, number of classes, and weights you specify.
func (*MLCLossLayer) Descriptor ¶
func (o *MLCLossLayer) Descriptor() *MLCLossDescriptor
@property descriptor @abstract The loss descriptor
func (*MLCLossLayer) Weights ¶
func (o *MLCLossLayer) Weights() *MLCTensor
@property weights @abstract The loss label weights tensor
type MLCLossType ¶
type MLCLossType int64
A loss function.
const ( // The mean absolute error loss. MLCLossTypeMeanAbsoluteError MLCLossType = 0 // The mean squared error loss. MLCLossTypeMeanSquaredError MLCLossType = 1 // The softmax cross entropy loss. MLCLossTypeSoftmaxCrossEntropy MLCLossType = 2 // The sigmoid cross entropy loss. MLCLossTypeSigmoidCrossEntropy MLCLossType = 3 // The categorical cross entropy loss. MLCLossTypeCategoricalCrossEntropy MLCLossType = 4 // The hinge loss. MLCLossTypeHinge MLCLossType = 5 // The Huber loss. MLCLossTypeHuber MLCLossType = 6 // The cosine distance loss. MLCLossTypeCosineDistance MLCLossType = 7 // The log loss. MLCLossTypeLog MLCLossType = 8 MLCLossTypeCount MLCLossType = 9 )
func (MLCLossType) String ¶
func (e MLCLossType) String() string
type MLCMatMulDescriptor ¶
type MLCMatMulDescriptor struct {
foundation.NSObject
}
A configuration object you use to create a matrix multiplication layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcmatmuldescriptor
func MLCMatMulDescriptorDescriptor ¶
func MLCMatMulDescriptorDescriptor() *MLCMatMulDescriptor
Creates a batched matrix multiplication descriptor.
func MLCMatMulDescriptorDescriptorWithAlphaTransposesXTransposesY ¶
func MLCMatMulDescriptorDescriptorWithAlphaTransposesXTransposesY(alpha float32, transposesX bool, transposesY bool) *MLCMatMulDescriptor
Creates a batched matrix multiplication descriptor with the alpha value and transpose options you specify.
func MLCMatMulDescriptorFromID ¶
func MLCMatMulDescriptorFromID(id objc.ID) *MLCMatMulDescriptor
func (*MLCMatMulDescriptor) Alpha ¶
func (o *MLCMatMulDescriptor) Alpha() float32
@brief a scalar to scale the result in C=alpha x X x Y. Default = 1.0
func (*MLCMatMulDescriptor) TransposesX ¶
func (o *MLCMatMulDescriptor) TransposesX() bool
@brief if true, transposes the last two dimensions of X. Default = False
func (*MLCMatMulDescriptor) TransposesY ¶
func (o *MLCMatMulDescriptor) TransposesY() bool
@brief if true, transposes the last two dimensions of Y. Default = False
type MLCMatMulLayer ¶
type MLCMatMulLayer struct {
MLCLayer
}
A layer that multiplies matrices.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcmatmullayer
func MLCMatMulLayerFromID ¶
func MLCMatMulLayerFromID(id objc.ID) *MLCMatMulLayer
func MLCMatMulLayerLayerWithDescriptor ¶
func MLCMatMulLayerLayerWithDescriptor(descriptor *MLCMatMulDescriptor) *MLCMatMulLayer
Creates a matrix multiplication layer with the specified descriptor you specify.
func (*MLCMatMulLayer) Descriptor ¶
func (o *MLCMatMulLayer) Descriptor() *MLCMatMulDescriptor
@property descriptor @abstract The matrix multiplication descriptor
type MLCMultiheadAttentionDescriptor ¶
type MLCMultiheadAttentionDescriptor struct {
foundation.NSObject
}
A configuration object you use to create a multi-head attention layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcmultiheadattentiondescriptor
func MLCMultiheadAttentionDescriptorDescriptorWithModelDimensionHeadCount ¶
func MLCMultiheadAttentionDescriptorDescriptorWithModelDimensionHeadCount(modelDimension uint, headCount uint) *MLCMultiheadAttentionDescriptor
Creates a multi-head attention descriptor with the model dimension and number of parallel attention heads you specify.
func MLCMultiheadAttentionDescriptorDescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention ¶
func MLCMultiheadAttentionDescriptorDescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention(modelDimension uint, keyDimension uint, valueDimension uint, headCount uint, dropout float32, hasBiases bool, hasAttentionBiases bool, addsZeroAttention bool) *MLCMultiheadAttentionDescriptor
Creates a multi-head attention descriptor with the dimensions, number of attention heads, dropout rate, and bias and padding options you specify.
func MLCMultiheadAttentionDescriptorFromID ¶
func MLCMultiheadAttentionDescriptorFromID(id objc.ID) *MLCMultiheadAttentionDescriptor
func (*MLCMultiheadAttentionDescriptor) AddsZeroAttention ¶
func (o *MLCMultiheadAttentionDescriptor) AddsZeroAttention() bool
@brief if true, a row of zeroes is added to projected key and value. Default = false
func (*MLCMultiheadAttentionDescriptor) Dropout ¶
func (o *MLCMultiheadAttentionDescriptor) Dropout() float32
@brief a droupout layer applied to the output projection weights. Default = 0.0
func (*MLCMultiheadAttentionDescriptor) HasAttentionBiases ¶
func (o *MLCMultiheadAttentionDescriptor) HasAttentionBiases() bool
@brief if true, an array of biases is added to key and value respectively. Default = false
func (*MLCMultiheadAttentionDescriptor) HasBiases ¶
func (o *MLCMultiheadAttentionDescriptor) HasBiases() bool
@brief if true, bias is used for query/key/value/output projections. Default = true
func (*MLCMultiheadAttentionDescriptor) HeadCount ¶
func (o *MLCMultiheadAttentionDescriptor) HeadCount() uint
@brief number of parallel attention heads
func (*MLCMultiheadAttentionDescriptor) KeyDimension ¶
func (o *MLCMultiheadAttentionDescriptor) KeyDimension() uint
@brief total dimension of key space, Default = modelDimension
func (*MLCMultiheadAttentionDescriptor) ModelDimension ¶
func (o *MLCMultiheadAttentionDescriptor) ModelDimension() uint
@brief model or embedding dimension
func (*MLCMultiheadAttentionDescriptor) ValueDimension ¶
func (o *MLCMultiheadAttentionDescriptor) ValueDimension() uint
@brief total dimension of value space, Default = modelDimension
type MLCMultiheadAttentionLayer ¶
type MLCMultiheadAttentionLayer struct {
MLCLayer
}
A multihead, scaled dot-product attention layer that attends to one or more entries in the input key-value pairs.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcmultiheadattentionlayer
func MLCMultiheadAttentionLayerFromID ¶
func MLCMultiheadAttentionLayerFromID(id objc.ID) *MLCMultiheadAttentionLayer
func MLCMultiheadAttentionLayerLayerWithDescriptorWeightsBiasesAttentionBiases ¶
func MLCMultiheadAttentionLayerLayerWithDescriptorWeightsBiasesAttentionBiases(descriptor *MLCMultiheadAttentionDescriptor, weights *foundation.NSArray[*MLCTensor], biases *foundation.NSArray[*MLCTensor], attentionBiases *foundation.NSArray[*MLCTensor]) *MLCMultiheadAttentionLayer
Creates a multi-head attention layer with the descriptor, weights, and biases you specify.
func (*MLCMultiheadAttentionLayer) AttentionBiases ¶
func (o *MLCMultiheadAttentionLayer) AttentionBiases() *foundation.NSArray[*MLCTensor]
@property attentionBiases @abstract The biases added to key and value
func (*MLCMultiheadAttentionLayer) Biases ¶
func (o *MLCMultiheadAttentionLayer) Biases() *foundation.NSArray[*MLCTensor]
@property biases @abstract The biases of query, key, value and output projections
func (*MLCMultiheadAttentionLayer) BiasesParameters ¶
func (o *MLCMultiheadAttentionLayer) BiasesParameters() *foundation.NSArray[*MLCTensorParameter]
@property biasesParameters @abstract The biases tensor parameters used for optimizer update
func (*MLCMultiheadAttentionLayer) Descriptor ¶
func (o *MLCMultiheadAttentionLayer) Descriptor() *MLCMultiheadAttentionDescriptor
@property descriptor @abstract The multi-head attention descriptor
func (*MLCMultiheadAttentionLayer) Weights ¶
func (o *MLCMultiheadAttentionLayer) Weights() *foundation.NSArray[*MLCTensor]
@property weights @abstract The weights of query, key, value and output projections
func (*MLCMultiheadAttentionLayer) WeightsParameters ¶
func (o *MLCMultiheadAttentionLayer) WeightsParameters() *foundation.NSArray[*MLCTensorParameter]
@property weightsParameters @abstract The weights tensor parameters used for optimizer update
type MLCOptimizer ¶
type MLCOptimizer struct {
foundation.NSObject
}
The base class for all framework optimizers.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcoptimizer
func MLCOptimizerFromID ¶
func MLCOptimizerFromID(id objc.ID) *MLCOptimizer
func (*MLCOptimizer) AppliesGradientClipping ¶
func (o *MLCOptimizer) AppliesGradientClipping() bool
@property appliesGradientClipping @abstract Whether gradient clipping should be applied or not.
func (*MLCOptimizer) CustomGlobalNorm ¶
func (o *MLCOptimizer) CustomGlobalNorm() float32
@property customGlobalNorm @abstract Used only with MLCGradientClippingTypeByGlobalNorm. If non zero, this norm will be used in place of global norm.
func (*MLCOptimizer) GradientClipMax ¶
func (o *MLCOptimizer) GradientClipMax() float32
@property gradientClipMax @abstract The maximum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*MLCOptimizer) GradientClipMin ¶
func (o *MLCOptimizer) GradientClipMin() float32
@property gradientClipMin @abstract The minimum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*MLCOptimizer) GradientClippingType ¶
func (o *MLCOptimizer) GradientClippingType() MLCGradientClippingType
@property gradientClippingType @abstract The type of clipping applied to gradient
func (*MLCOptimizer) GradientRescale ¶
func (o *MLCOptimizer) GradientRescale() float32
@property gradientRescale @abstract The rescale value applied to gradients during optimizer update
func (*MLCOptimizer) LearningRate ¶
func (o *MLCOptimizer) LearningRate() float32
@property learningRate @abstract The learning rate. This property is 'readwrite' so that callers can implement a 'decay' during training
func (*MLCOptimizer) MaximumClippingNorm ¶
func (o *MLCOptimizer) MaximumClippingNorm() float32
@property maximumClippingNorm @abstract The maximum clipping value
func (*MLCOptimizer) RegularizationScale ¶
func (o *MLCOptimizer) RegularizationScale() float32
@property regularizationScale @abstract The regularization scale.
func (*MLCOptimizer) RegularizationType ¶
func (o *MLCOptimizer) RegularizationType() MLCRegularizationType
@property regularizationType @abstract The regularization type.
func (*MLCOptimizer) SetAppliesGradientClipping ¶
func (o *MLCOptimizer) SetAppliesGradientClipping(appliesGradientClipping bool)
func (*MLCOptimizer) SetLearningRate ¶
func (o *MLCOptimizer) SetLearningRate(learningRate float32)
type MLCOptimizerDescriptor ¶
type MLCOptimizerDescriptor struct {
foundation.NSObject
}
A configuration object you use to create an optimizer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcoptimizerdescriptor
func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale ¶
func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, gradientClipMax float32, gradientClipMin float32, regularizationType MLCRegularizationType, regularizationScale float32) *MLCOptimizerDescriptor
Creates a descriptor with the learning rate, gradient rescale, clipping option and values, and regularization type and scale that you specify.
func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale ¶
func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, gradientClippingType MLCGradientClippingType, gradientClipMax float32, gradientClipMin float32, maximumClippingNorm float32, customGlobalNorm float32, regularizationType MLCRegularizationType, regularizationScale float32) *MLCOptimizerDescriptor
Creates a descriptor with the learning rate, gradient rescale, clipping option and values, and regularization type and scale that you specify.
func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale ¶
func MLCOptimizerDescriptorDescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, regularizationType MLCRegularizationType, regularizationScale float32) *MLCOptimizerDescriptor
Creates an optimizer descriptor with the learning rate, gradient rescale, regularization type, and regulation scale that you specify.
func MLCOptimizerDescriptorFromID ¶
func MLCOptimizerDescriptorFromID(id objc.ID) *MLCOptimizerDescriptor
func (*MLCOptimizerDescriptor) AppliesGradientClipping ¶
func (o *MLCOptimizerDescriptor) AppliesGradientClipping() bool
@property appliesGradientClipping @abstract Whether gradient clipping should be applied or not. @discussion The default is false
func (*MLCOptimizerDescriptor) CustomGlobalNorm ¶
func (o *MLCOptimizerDescriptor) CustomGlobalNorm() float32
@property customGlobalNorm @abstract Used only with MLCGradientClippingTypeByGlobalNorm. If non zero, this norm will be used in place of global norm.
func (*MLCOptimizerDescriptor) GradientClipMax ¶
func (o *MLCOptimizerDescriptor) GradientClipMax() float32
@property gradientClipMax @abstract The maximum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*MLCOptimizerDescriptor) GradientClipMin ¶
func (o *MLCOptimizerDescriptor) GradientClipMin() float32
@property gradientClipMin @abstract The minimum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*MLCOptimizerDescriptor) GradientClippingType ¶
func (o *MLCOptimizerDescriptor) GradientClippingType() MLCGradientClippingType
@property gradientClippingType @abstract The type of clipping applied to gradient
func (*MLCOptimizerDescriptor) GradientRescale ¶
func (o *MLCOptimizerDescriptor) GradientRescale() float32
@property gradientRescale @abstract The rescale value applied to gradients during optimizer update
func (*MLCOptimizerDescriptor) LearningRate ¶
func (o *MLCOptimizerDescriptor) LearningRate() float32
@property learningRate @abstract The learning rate
func (*MLCOptimizerDescriptor) MaximumClippingNorm ¶
func (o *MLCOptimizerDescriptor) MaximumClippingNorm() float32
@property maximumClippingNorm @abstract The maximum clipping value
func (*MLCOptimizerDescriptor) RegularizationScale ¶
func (o *MLCOptimizerDescriptor) RegularizationScale() float32
@property regularizationScale @abstract The regularization scale.
func (*MLCOptimizerDescriptor) RegularizationType ¶
func (o *MLCOptimizerDescriptor) RegularizationType() MLCRegularizationType
@property regularizationType @abstract The regularization type.
type MLCPaddingLayer ¶
type MLCPaddingLayer struct {
MLCLayer
}
A layer that pads a tensor with the padding sizes you specify.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcpaddinglayer
func MLCPaddingLayerFromID ¶
func MLCPaddingLayerFromID(id objc.ID) *MLCPaddingLayer
func MLCPaddingLayerLayerWithConstantPaddingConstantValue ¶
func MLCPaddingLayerLayerWithConstantPaddingConstantValue(padding *foundation.NSArray[*foundation.NSNumber], constantValue float32) *MLCPaddingLayer
Creates a padding layer with the constant padding sizes and constant valu you specify.
func MLCPaddingLayerLayerWithReflectionPadding ¶
func MLCPaddingLayerLayerWithReflectionPadding(padding *foundation.NSArray[*foundation.NSNumber]) *MLCPaddingLayer
Creates a padding layer with the reflection padding sizes you specify.
func MLCPaddingLayerLayerWithSymmetricPadding ¶
func MLCPaddingLayerLayerWithSymmetricPadding(padding *foundation.NSArray[*foundation.NSNumber]) *MLCPaddingLayer
Creates a padding layer with the symmetric padding sizes you specify.
func MLCPaddingLayerLayerWithZeroPadding ¶
func MLCPaddingLayerLayerWithZeroPadding(padding *foundation.NSArray[*foundation.NSNumber]) *MLCPaddingLayer
Creates a padding layer with the zero padding sizes you specify.
func (*MLCPaddingLayer) ConstantValue ¶
func (o *MLCPaddingLayer) ConstantValue() float32
@property constantValue @abstract The constant value to use if padding type is constant.
func (*MLCPaddingLayer) PaddingBottom ¶
func (o *MLCPaddingLayer) PaddingBottom() uint
@property paddingBottom @abstract The bottom padding size
func (*MLCPaddingLayer) PaddingLeft ¶
func (o *MLCPaddingLayer) PaddingLeft() uint
@property paddingLeft @abstract The left padding size
func (*MLCPaddingLayer) PaddingRight ¶
func (o *MLCPaddingLayer) PaddingRight() uint
@property paddingRight @abstract The right padding size
func (*MLCPaddingLayer) PaddingTop ¶
func (o *MLCPaddingLayer) PaddingTop() uint
@property paddingTop @abstract The top padding size
func (*MLCPaddingLayer) PaddingType ¶
func (o *MLCPaddingLayer) PaddingType() MLCPaddingType
@property paddingType @abstract The padding type i.e. constant, zero, reflect or symmetric
type MLCPaddingPolicy ¶
type MLCPaddingPolicy int64
A padding policy that you specify for a convolution or pooling layer.
const ( // The "same" padding policy. MLCPaddingPolicySame MLCPaddingPolicy = 0 // The "valid" padding policy. MLCPaddingPolicyValid MLCPaddingPolicy = 1 // The choice to use explicitly specified padding sizes. MLCPaddingPolicyUsePaddingSize MLCPaddingPolicy = 2 )
func (MLCPaddingPolicy) String ¶
func (e MLCPaddingPolicy) String() string
type MLCPaddingType ¶
type MLCPaddingType int64
A padding type that you specify for a padding layer.
const ( // The zero padding type. MLCPaddingTypeZero MLCPaddingType = 0 // The reflect padding type. MLCPaddingTypeReflect MLCPaddingType = 1 // The symmetric padding type. MLCPaddingTypeSymmetric MLCPaddingType = 2 // The constant padding type. MLCPaddingTypeConstant MLCPaddingType = 3 )
func (MLCPaddingType) String ¶
func (e MLCPaddingType) String() string
type MLCPlatform ¶
type MLCPlatform struct {
foundation.NSObject
}
A utility class for setting global properties in the framework.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcplatform
func MLCPlatformFromID ¶
func MLCPlatformFromID(id objc.ID) *MLCPlatform
type MLCPoolingDescriptor ¶
type MLCPoolingDescriptor struct {
foundation.NSObject
}
A configuration object you use to create a pooling layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcpoolingdescriptor
func MLCPoolingDescriptorAveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding ¶
func MLCPoolingDescriptorAveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes *foundation.NSArray[*foundation.NSNumber], strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber], countIncludesPadding bool) *MLCPoolingDescriptor
Creates an average pooling descriptor with the kernel sizes, strides, dilution rates, padding policy and sizes, and zero padding option you specify.
func MLCPoolingDescriptorAveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding ¶
func MLCPoolingDescriptorAveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes *foundation.NSArray[*foundation.NSNumber], strides *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber], countIncludesPadding bool) *MLCPoolingDescriptor
Creates an average pooling descriptor with the kernel sizes, strides, padding policy, padding sizes, and zero padding option that you specify.
func MLCPoolingDescriptorFromID ¶
func MLCPoolingDescriptorFromID(id objc.ID) *MLCPoolingDescriptor
func MLCPoolingDescriptorL2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes ¶
func MLCPoolingDescriptorL2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCPoolingDescriptor
Creates a descriptor for an L2 norm pooling function with the kernel sizes, strides, dilation rates, padding policy, and padding sizes you specify.
func MLCPoolingDescriptorL2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes ¶
func MLCPoolingDescriptorL2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], strides *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCPoolingDescriptor
Creates a descriptor for an L2 norm pooling function with the kernel sizes, strides, padding policy, and padding sizes that you specify.
func MLCPoolingDescriptorMaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes ¶
func MLCPoolingDescriptorMaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], strides *foundation.NSArray[*foundation.NSNumber], dilationRates *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCPoolingDescriptor
Creates a descriptor for a max pooling function with the kernel sizes, strides, dilation rates, padding policy, and padding sizes that you specify.
func MLCPoolingDescriptorMaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes ¶
func MLCPoolingDescriptorMaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes *foundation.NSArray[*foundation.NSNumber], strides *foundation.NSArray[*foundation.NSNumber], paddingPolicy MLCPaddingPolicy, paddingSizes *foundation.NSArray[*foundation.NSNumber]) *MLCPoolingDescriptor
Creates a descriptor for a max pooling function with the kernel sizes, strides, padding policy, and padding sizes that you specify.
func MLCPoolingDescriptorPoolingDescriptorWithTypeKernelSizeStride ¶
func MLCPoolingDescriptorPoolingDescriptorWithTypeKernelSizeStride(poolingType MLCPoolingType, kernelSize uint, stride uint) *MLCPoolingDescriptor
Creates a pooling descriptor with the pooling function, kernel size, and stride you specify.
func (*MLCPoolingDescriptor) CountIncludesPadding ¶
func (o *MLCPoolingDescriptor) CountIncludesPadding() bool
@property countIncludesPadding @abstract Include the zero-padding in the averaging calculation if true. Used only with average pooling.
func (*MLCPoolingDescriptor) DilationRateInX ¶
func (o *MLCPoolingDescriptor) DilationRateInX() uint
@property dilationRateInX @abstract The dilation rate i.e. stride of elements in the kernel in x.
func (*MLCPoolingDescriptor) DilationRateInY ¶
func (o *MLCPoolingDescriptor) DilationRateInY() uint
@property dilationRateInY @abstract The dilation rate i.e. stride of elements in the kernel in y.
func (*MLCPoolingDescriptor) KernelHeight ¶
func (o *MLCPoolingDescriptor) KernelHeight() uint
@property kernelHeight @abstract The pooling kernel size in y.
func (*MLCPoolingDescriptor) KernelWidth ¶
func (o *MLCPoolingDescriptor) KernelWidth() uint
@property kernelWidth @abstract The pooling kernel size in x.
func (*MLCPoolingDescriptor) PaddingPolicy ¶
func (o *MLCPoolingDescriptor) PaddingPolicy() MLCPaddingPolicy
@property paddingPolicy @abstract The padding policy to use.
func (*MLCPoolingDescriptor) PaddingSizeInX ¶
func (o *MLCPoolingDescriptor) PaddingSizeInX() uint
@property paddingSizeInX @abstract The padding size in x (left and right) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*MLCPoolingDescriptor) PaddingSizeInY ¶
func (o *MLCPoolingDescriptor) PaddingSizeInY() uint
@property paddingSizeInY @abstract The padding size in y (top and bottom) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*MLCPoolingDescriptor) PoolingType ¶
func (o *MLCPoolingDescriptor) PoolingType() MLCPoolingType
@property poolingType @abstract The pooling operation
func (*MLCPoolingDescriptor) StrideInX ¶
func (o *MLCPoolingDescriptor) StrideInX() uint
@property strideInX @abstract The stride of the kernel in x.
func (*MLCPoolingDescriptor) StrideInY ¶
func (o *MLCPoolingDescriptor) StrideInY() uint
@property strideInY @abstract The stride of the kernel in y.
type MLCPoolingLayer ¶
type MLCPoolingLayer struct {
MLCLayer
}
A layer that summarizes the average presence of a feature.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcpoolinglayer
func MLCPoolingLayerFromID ¶
func MLCPoolingLayerFromID(id objc.ID) *MLCPoolingLayer
func MLCPoolingLayerLayerWithDescriptor ¶
func MLCPoolingLayerLayerWithDescriptor(descriptor *MLCPoolingDescriptor) *MLCPoolingLayer
Creates a pooling layer with the descriptor you specify.
func (*MLCPoolingLayer) Descriptor ¶
func (o *MLCPoolingLayer) Descriptor() *MLCPoolingDescriptor
@property descriptor @abstract The pooling descriptor
type MLCPoolingType ¶
type MLCPoolingType int64
A pooling function type for a pooling layer.
const ( // The max pooling type. MLCPoolingTypeMax MLCPoolingType = 1 // The average pooling type. MLCPoolingTypeAverage MLCPoolingType = 2 // The L2-norm pooling type. MLCPoolingTypeL2Norm MLCPoolingType = 3 MLCPoolingTypeCount MLCPoolingType = 4 )
func (MLCPoolingType) String ¶
func (e MLCPoolingType) String() string
type MLCRMSPropOptimizer ¶
type MLCRMSPropOptimizer struct {
MLCOptimizer
}
An optimizer that represents the root mean square propagation algorithm.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcrmspropoptimizer Deprecated: Use Metal Performance Shaders Graph or BNNS instead.
func MLCRMSPropOptimizerFromID ¶
func MLCRMSPropOptimizerFromID(id objc.ID) *MLCRMSPropOptimizer
func MLCRMSPropOptimizerOptimizerWithDescriptor ¶
func MLCRMSPropOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCRMSPropOptimizer
Creates an RMSProp optimizer with the descriptor you specify.
func MLCRMSPropOptimizerOptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered ¶
func MLCRMSPropOptimizerOptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered(optimizerDescriptor *MLCOptimizerDescriptor, momentumScale float32, alpha float32, epsilon float32, isCentered bool) *MLCRMSPropOptimizer
Creates an RMSProp optimizer with the descriptor, momentum scale, smoothing, epsilon, and option to compute the centered RMSProp that you specify.
func (*MLCRMSPropOptimizer) Alpha ¶
func (o *MLCRMSPropOptimizer) Alpha() float32
@property alpha @abstract The smoothing constant. @discussion The default is 0.99.
func (*MLCRMSPropOptimizer) Epsilon ¶
func (o *MLCRMSPropOptimizer) Epsilon() float32
@property epsilon @abstract A term added to improve numerical stability. @discussion The default is 1e-8.
func (*MLCRMSPropOptimizer) IsCentered ¶
func (o *MLCRMSPropOptimizer) IsCentered() bool
@property isCentered @abstract If True, compute the centered RMSProp, the gradient is normalized by an estimation of its variance. @discussion The default is false.
func (*MLCRMSPropOptimizer) MomentumScale ¶
func (o *MLCRMSPropOptimizer) MomentumScale() float32
@property momentumScale @abstract The momentum factor. A hyper-parameter. @discussion The default is 0.0.
type MLCRandomInitializerType ¶
type MLCRandomInitializerType int64
An initializer type you use to create a tensor with random data.
const ( MLCRandomInitializerTypeInvalid MLCRandomInitializerType = 0 // The uniform random initializer type. MLCRandomInitializerTypeUniform MLCRandomInitializerType = 1 // The glorot uniform random initializer type. MLCRandomInitializerTypeGlorotUniform MLCRandomInitializerType = 2 // The Xavier random initializer type. MLCRandomInitializerTypeXavier MLCRandomInitializerType = 3 MLCRandomInitializerTypeCount MLCRandomInitializerType = 4 )
func (MLCRandomInitializerType) String ¶
func (e MLCRandomInitializerType) String() string
type MLCReductionLayer ¶
type MLCReductionLayer struct {
MLCLayer
}
A layer that reduces tensor values across a specific dimension to a scalar value.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcreductionlayer
func MLCReductionLayerFromID ¶
func MLCReductionLayerFromID(id objc.ID) *MLCReductionLayer
func MLCReductionLayerLayerWithReductionTypeDimension ¶
func MLCReductionLayerLayerWithReductionTypeDimension(reductionType MLCReductionType, dimension uint) *MLCReductionLayer
Creates a reduction layer using the reduction type and dimension you specify.
func MLCReductionLayerLayerWithReductionTypeDimensions ¶
func MLCReductionLayerLayerWithReductionTypeDimensions(reductionType MLCReductionType, dimensions *foundation.NSArray[*foundation.NSNumber]) *MLCReductionLayer
Creates a reduction layer using the reduction type and dimensions you specify.
func (*MLCReductionLayer) Dimension ¶
func (o *MLCReductionLayer) Dimension() uint
@property dimension @abstract The dimension over which to perform the reduction operation
func (*MLCReductionLayer) Dimensions ¶
func (o *MLCReductionLayer) Dimensions() *foundation.NSArray[*foundation.NSNumber]
@property dimensions @abstract The dimensions over which to perform the reduction operation
func (*MLCReductionLayer) ReductionType ¶
func (o *MLCReductionLayer) ReductionType() MLCReductionType
@property reductionType @abstract The reduction type
type MLCReductionType ¶
type MLCReductionType int64
Constants that describe a reduction operation type.
const ( // A reduction operation that applies no reduction. MLCReductionTypeNone MLCReductionType = 0 // A reduction operation that applies to the sum of the dimensions. MLCReductionTypeSum MLCReductionType = 1 // A reduction operation that applies to the mean of the dimensions. MLCReductionTypeMean MLCReductionType = 2 // A reduction operation that applies to the maximum dimension. MLCReductionTypeMax MLCReductionType = 3 // A reduction operation that applies to the minimum dimension. MLCReductionTypeMin MLCReductionType = 4 // A reduction operation that applies to the maximum dimension you specify. MLCReductionTypeArgMax MLCReductionType = 5 // A reduction operation that applies to the minimum dimension you specify. MLCReductionTypeArgMin MLCReductionType = 6 // A reduction operation that applies a lasso regularization penalty. MLCReductionTypeL1Norm MLCReductionType = 7 // A reduction operation that applies to any dimension. MLCReductionTypeAny MLCReductionType = 8 // A reduction operation that applies to all dimensions. MLCReductionTypeAll MLCReductionType = 9 // The total number of reduction operations. MLCReductionTypeCount MLCReductionType = 10 )
func (MLCReductionType) String ¶
func (e MLCReductionType) String() string
type MLCRegularizationType ¶
type MLCRegularizationType int64
A regularization function to use with an optimizer.
const ( // No regularization. MLCRegularizationTypeNone MLCRegularizationType = 0 // The L1 regularization. MLCRegularizationTypeL1 MLCRegularizationType = 1 // The L2 regularization. MLCRegularizationTypeL2 MLCRegularizationType = 2 )
func (MLCRegularizationType) String ¶
func (e MLCRegularizationType) String() string
type MLCReshapeLayer ¶
type MLCReshapeLayer struct {
MLCLayer
}
A layer that reshapes a tensor with the shape you specify.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcreshapelayer
func MLCReshapeLayerFromID ¶
func MLCReshapeLayerFromID(id objc.ID) *MLCReshapeLayer
func MLCReshapeLayerLayerWithShape ¶
func MLCReshapeLayerLayerWithShape(shape *foundation.NSArray[*foundation.NSNumber]) *MLCReshapeLayer
Creates a reshape layer with the shape you specify.
func (*MLCReshapeLayer) Shape ¶
func (o *MLCReshapeLayer) Shape() *foundation.NSArray[*foundation.NSNumber]
@property shape @abstract The target shape.
type MLCSGDOptimizer ¶
type MLCSGDOptimizer struct {
MLCOptimizer
}
An optimizer that represents the stochastic gradient decent algorithm.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcsgdoptimizer
func MLCSGDOptimizerFromID ¶
func MLCSGDOptimizerFromID(id objc.ID) *MLCSGDOptimizer
func MLCSGDOptimizerOptimizerWithDescriptor ¶
func MLCSGDOptimizerOptimizerWithDescriptor(optimizerDescriptor *MLCOptimizerDescriptor) *MLCSGDOptimizer
Creates an SGD optimizer with the descriptor you specify.
func MLCSGDOptimizerOptimizerWithDescriptorMomentumScaleUsesNesterovMomentum ¶
func MLCSGDOptimizerOptimizerWithDescriptorMomentumScaleUsesNesterovMomentum(optimizerDescriptor *MLCOptimizerDescriptor, momentumScale float32, usesNesterovMomentum bool) *MLCSGDOptimizer
Create an SGD optimizer with the descriptor, momentum scale, and option to enable Nesterov momentum that you specify.
func (*MLCSGDOptimizer) MomentumScale ¶
func (o *MLCSGDOptimizer) MomentumScale() float32
@property momentumScale @abstract The momentum factor. A hyper-parameter. @discussion The default is 0.0.
func (*MLCSGDOptimizer) UsesNesterovMomentum ¶
func (o *MLCSGDOptimizer) UsesNesterovMomentum() bool
@property usesNesterovMomentum @abstract A boolean that specifies whether to apply nesterov momentum or not. @discussion The default is false.
type MLCSampleMode ¶
type MLCSampleMode int64
A sampling mode for an upsample layer.
const ( // The nearest sample mode. MLCSampleModeNearest MLCSampleMode = 0 // The linear sample mode. MLCSampleModeLinear MLCSampleMode = 1 )
func (MLCSampleMode) String ¶
func (e MLCSampleMode) String() string
type MLCScatterLayer ¶
type MLCScatterLayer struct {
MLCLayer
}
A layer that updates the output at an index you specify.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcscatterlayer
func MLCScatterLayerFromID ¶
func MLCScatterLayerFromID(id objc.ID) *MLCScatterLayer
func MLCScatterLayerLayerWithDimensionReductionType ¶
func MLCScatterLayerLayerWithDimensionReductionType(dimension uint, reductionType MLCReductionType) *MLCScatterLayer
Creates a scatter layer with the dimension and reduction type you specify.
func (*MLCScatterLayer) Dimension ¶
func (o *MLCScatterLayer) Dimension() uint
@property dimension @abstract The dimension along which to index
func (*MLCScatterLayer) ReductionType ¶
func (o *MLCScatterLayer) ReductionType() MLCReductionType
@property reductionType @abstract The reduction type applied for all values in source tensor that are scattered to a specific location in the result tensor. Must be: MLCReductionTypeNone or MLCReductionTypeSum.
type MLCSelectionLayer ¶
type MLCSelectionLayer struct {
MLCLayer
}
A layer for selecting elements from two tensors.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcselectionlayer
func MLCSelectionLayerFromID ¶
func MLCSelectionLayerFromID(id objc.ID) *MLCSelectionLayer
func MLCSelectionLayerLayer ¶
func MLCSelectionLayerLayer() *MLCSelectionLayer
Creates a selection layer.
type MLCSliceLayer ¶
type MLCSliceLayer struct {
MLCLayer
}
A layer that extracts a slice from a tensor.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcslicelayer
func MLCSliceLayerFromID ¶
func MLCSliceLayerFromID(id objc.ID) *MLCSliceLayer
func MLCSliceLayerSliceLayerWithStartEndStride ¶
func MLCSliceLayerSliceLayerWithStartEndStride(start *foundation.NSArray[*foundation.NSNumber], end *foundation.NSArray[*foundation.NSNumber], stride *foundation.NSArray[*foundation.NSNumber]) *MLCSliceLayer
Creates a slice layer with the specified start, end, and stride.
func (*MLCSliceLayer) End ¶
func (o *MLCSliceLayer) End() *foundation.NSArray[*foundation.NSNumber]
@property end @abstract A vector of length equal to that of source. The element at index i specifies the end of slice in dimension i.
func (*MLCSliceLayer) Start ¶
func (o *MLCSliceLayer) Start() *foundation.NSArray[*foundation.NSNumber]
@property start @abstract A vector of length equal to that of source. The element at index i specifies the beginning of slice in dimension i.
func (*MLCSliceLayer) Stride ¶
func (o *MLCSliceLayer) Stride() *foundation.NSArray[*foundation.NSNumber]
@property stride @abstract A vector of length equal to that of source. The element at index i specifies the stride of slice in dimension i.
type MLCSoftmaxLayer ¶
type MLCSoftmaxLayer struct {
MLCLayer
}
A layer that outputs a probability distribution as attention weights.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcsoftmaxlayer
func MLCSoftmaxLayerFromID ¶
func MLCSoftmaxLayerFromID(id objc.ID) *MLCSoftmaxLayer
func MLCSoftmaxLayerLayerWithOperation ¶
func MLCSoftmaxLayerLayerWithOperation(operation MLCSoftmaxOperation) *MLCSoftmaxLayer
Creates a softmax layer with the operation you specify.
func MLCSoftmaxLayerLayerWithOperationDimension ¶
func MLCSoftmaxLayerLayerWithOperationDimension(operation MLCSoftmaxOperation, dimension uint) *MLCSoftmaxLayer
Creates a softmax layer with the operation and dimension you specify.
func (*MLCSoftmaxLayer) Dimension ¶
func (o *MLCSoftmaxLayer) Dimension() uint
@property dimension @abstract The dimension over which softmax operation should be performed
func (*MLCSoftmaxLayer) Operation ¶
func (o *MLCSoftmaxLayer) Operation() MLCSoftmaxOperation
@property operation @abstract The softmax operation. Supported values are softmax and log softmax.
type MLCSoftmaxOperation ¶
type MLCSoftmaxOperation int64
A softmax operation.
const ( // The standard softmax operation. MLCSoftmaxOperationSoftmax MLCSoftmaxOperation = 0 // The log softmax operation. MLCSoftmaxOperationLogSoftmax MLCSoftmaxOperation = 1 )
func (MLCSoftmaxOperation) String ¶
func (e MLCSoftmaxOperation) String() string
type MLCSplitLayer ¶
type MLCSplitLayer struct {
MLCLayer
}
A layer that splits a tensor value into a list of subtensors.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcsplitlayer
func MLCSplitLayerFromID ¶
func MLCSplitLayerFromID(id objc.ID) *MLCSplitLayer
func MLCSplitLayerLayerWithSplitCountDimension ¶
func MLCSplitLayerLayerWithSplitCountDimension(splitCount uint, dimension uint) *MLCSplitLayer
Creates a split layer with the number of splits and dimension you specify.
func MLCSplitLayerLayerWithSplitSectionLengthsDimension ¶
func MLCSplitLayerLayerWithSplitSectionLengthsDimension(splitSectionLengths *foundation.NSArray[*foundation.NSNumber], dimension uint) *MLCSplitLayer
Creates a split layer with the lengths of each split section and dimension you specify.
func (*MLCSplitLayer) Dimension ¶
func (o *MLCSplitLayer) Dimension() uint
@property dimension @abstract The dimension (or axis) along which to split tensor
func (*MLCSplitLayer) SplitCount ¶
func (o *MLCSplitLayer) SplitCount() uint
@property splitCount @abstract The number of splits. @discussion The tensor will be split into equally sized chunks. The last chunk may be smaller in size.
func (*MLCSplitLayer) SplitSectionLengths ¶
func (o *MLCSplitLayer) SplitSectionLengths() *foundation.NSArray[*foundation.NSNumber]
@property splitSectionLengths @abstract Lengths of each split section. @discussion The tensor will be split into chunks along dimensions with sizes given in \p splitSectionLengths .
type MLCTensor ¶
type MLCTensor struct {
foundation.NSObject
}
The data object you use throughout the framework.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctensor
func MLCTensorFromID ¶
func MLCTensorTensorWithDescriptor ¶
func MLCTensorTensorWithDescriptor(tensorDescriptor *MLCTensorDescriptor) *MLCTensor
Creates a tensor without data, using the descriptor you specify.
func MLCTensorTensorWithDescriptorData ¶
func MLCTensorTensorWithDescriptorData(tensorDescriptor *MLCTensorDescriptor, data *MLCTensorData) *MLCTensor
Creates a tensor with the descriptor and data you specify.
func MLCTensorTensorWithDescriptorFillWithData ¶
func MLCTensorTensorWithDescriptorFillWithData(tensorDescriptor *MLCTensorDescriptor, fillData *foundation.NSNumber) *MLCTensor
Creates a tensor with the descriptor and scalar value you specify.
func MLCTensorTensorWithDescriptorRandomInitializerType ¶
func MLCTensorTensorWithDescriptorRandomInitializerType(tensorDescriptor *MLCTensorDescriptor, randomInitializerType MLCRandomInitializerType) *MLCTensor
Creates a tensor with the descriptor and random initializer type you specify.
func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSize ¶
func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSize(sequenceLength uint, featureChannelCount uint, batchSize uint) *MLCTensor
Creates a tensor without data, with the sequence length, number of feature channels, and batch size you specify.
func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSizeData ¶
func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSizeData(sequenceLength uint, featureChannelCount uint, batchSize uint, data *MLCTensorData) *MLCTensor
Creates a tensor with the sequence length, number of feature channels, batch size, and data you specify.
func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType ¶
func MLCTensorTensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType(sequenceLength uint, featureChannelCount uint, batchSize uint, randomInitializerType MLCRandomInitializerType) *MLCTensor
Creates a tensor with the sequence length, number of feature channels, batch size, and random initializer type you specify.
func MLCTensorTensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData ¶
func MLCTensorTensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData(sequenceLengths *foundation.NSArray[*foundation.NSNumber], sortedSequences bool, featureChannelCount uint, batchSize uint, data *MLCTensorData) *MLCTensor
Creates a tensor with the sequence lengths, sorting indicator, number of feature channels, batch size, and data you specify.
func MLCTensorTensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType ¶
func MLCTensorTensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType(sequenceLengths *foundation.NSArray[*foundation.NSNumber], sortedSequences bool, featureChannelCount uint, batchSize uint, randomInitializerType MLCRandomInitializerType) *MLCTensor
Creates a tensor with the sequence lengths, sorting indicator, number of feature channels, batch size, and random initializer type you specify.
func MLCTensorTensorWithShape ¶
func MLCTensorTensorWithShape(shape *foundation.NSArray[*foundation.NSNumber]) *MLCTensor
Creates a tensor without data, with the shape you specify.
func MLCTensorTensorWithShapeDataDataType ¶
func MLCTensorTensorWithShapeDataDataType(shape *foundation.NSArray[*foundation.NSNumber], data *MLCTensorData, dataType MLCDataType) *MLCTensor
Creates a tensor with the shape, data, and data type you specify.
func MLCTensorTensorWithShapeDataType ¶
func MLCTensorTensorWithShapeDataType(shape *foundation.NSArray[*foundation.NSNumber], dataType MLCDataType) *MLCTensor
Creates a tensor without data, with the shape and data type you specify.
func MLCTensorTensorWithShapeFillWithDataDataType ¶
func MLCTensorTensorWithShapeFillWithDataDataType(shape *foundation.NSArray[*foundation.NSNumber], fillData *foundation.NSNumber, dataType MLCDataType) *MLCTensor
Creates a tensor with the shape, scalar value, and data type you specify.
func MLCTensorTensorWithShapeRandomInitializerType ¶
func MLCTensorTensorWithShapeRandomInitializerType(shape *foundation.NSArray[*foundation.NSNumber], randomInitializerType MLCRandomInitializerType) *MLCTensor
Creates a tensor with the shape and random initializer type you specify.
func MLCTensorTensorWithShapeRandomInitializerTypeDataType ¶
func MLCTensorTensorWithShapeRandomInitializerTypeDataType(shape *foundation.NSArray[*foundation.NSNumber], randomInitializerType MLCRandomInitializerType, dataType MLCDataType) *MLCTensor
Creates a tensor with the shape, random initializer, and data type you specify.
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSize ¶
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSize(width uint, height uint, featureChannelCount uint, batchSize uint) *MLCTensor
Creates a tensor without data, with the sizes and number of feature channels you specify.
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeData ¶
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeData(width uint, height uint, featureChannelCount uint, batchSize uint, data *MLCTensorData) *MLCTensor
Creates a tensor with the sizes, number of feature channels, and data you specify.
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType ¶
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType(width uint, height uint, featureChannelCount uint, batchSize uint, data *MLCTensorData, dataType MLCDataType) *MLCTensor
Creates a tensor with the sizes, number of feature channels, data, and data type you specify.
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType ¶
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType(width uint, height uint, featureChannelCount uint, batchSize uint, fillData float32, dataType MLCDataType) *MLCTensor
Creates a tensor with the sizes and number of feature channels, and filled with the data and type you specify.
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType ¶
func MLCTensorTensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType(width uint, height uint, featureChannelCount uint, batchSize uint, randomInitializerType MLCRandomInitializerType) *MLCTensor
Creates a tensor with the sizes, number of feature channels, and random data using the random initializer type you specify.
func (*MLCTensor) BindAndWriteDataToDevice ¶
func (o *MLCTensor) BindAndWriteDataToDevice(data *MLCTensorData, device *MLCDevice) bool
Associates the given data to the tensor, and if the device is a GPU, also copies the data to the device memory.
func (*MLCTensor) BindOptimizerDataDeviceData ¶
func (o *MLCTensor) BindOptimizerDataDeviceData(data *foundation.NSArray[*MLCTensorData], deviceData *foundation.NSArray[*MLCTensorOptimizerDeviceData]) bool
Associates the optimizer and device data buffers you specify to the tensor.
func (*MLCTensor) CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice ¶
func (o *MLCTensor) CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice(bytes_ unsafe.Pointer, length uint, synchronizeWithDevice bool) bool
Copies tensor data from device memory to user-specified memory.
func (*MLCTensor) Data ¶
func (o *MLCTensor) Data() *foundation.NSData
@property data @abstract The tensor data
func (*MLCTensor) Descriptor ¶
func (o *MLCTensor) Descriptor() *MLCTensorDescriptor
@property descriptor @abstract The tensor descriptor
func (*MLCTensor) HasValidNumerics ¶
@abstract Returns a Boolean value indicating whether the underlying data has valid floating-point numerics, i.e. it does not contain NaN or INF floating-point values.
func (*MLCTensor) Label ¶
func (o *MLCTensor) Label() *foundation.NSString
@property label @abstract A string to help identify this object.
func (*MLCTensor) OptimizerData ¶
func (o *MLCTensor) OptimizerData() *foundation.NSArray[*MLCTensorData]
@property optimizer buffers to use if tensor is used as a parameter @abstract These are the host side optimizer (momentum and velocity) buffers which developers can query and initialize @discussion When customizing optimizer data, the contents of these buffers must be initialized before executing optimizer update for a graph.
func (*MLCTensor) OptimizerDeviceData ¶
func (o *MLCTensor) OptimizerDeviceData() *foundation.NSArray[*MLCTensorOptimizerDeviceData]
@property optimizer device buffers to use if tensor is used as a parameter @abstract These are the device side optimizer (momentum and velocity) buffers which developers can query
func (*MLCTensor) SetLabel ¶
func (o *MLCTensor) SetLabel(label *foundation.NSString)
func (*MLCTensor) SynchronizeData ¶
Synchronizes the data in host memory.
func (*MLCTensor) SynchronizeOptimizerData ¶
Synchronizes the optimizer data in host memory.
func (*MLCTensor) TensorByDequantizingToTypeScaleBias ¶
func (o *MLCTensor) TensorByDequantizingToTypeScaleBias(type_ MLCDataType, scale *MLCTensor, bias *MLCTensor) *MLCTensor
Converts a tensor you quantize to a 32-bit floating-point tensor.
func (*MLCTensor) TensorByDequantizingToTypeScaleBiasAxis ¶
func (o *MLCTensor) TensorByDequantizingToTypeScaleBiasAxis(type_ MLCDataType, scale *MLCTensor, bias *MLCTensor, axis int) *MLCTensor
Converts a tensor you quantize to a 32-bit floating-point tensor.
func (*MLCTensor) TensorByQuantizingToTypeScaleBias ¶
func (o *MLCTensor) TensorByQuantizingToTypeScaleBias(type_ MLCDataType, scale float32, bias int) *MLCTensor
Converts a 32-bit floating-point tensor with the scale and bias you specify.
func (*MLCTensor) TensorByQuantizingToTypeScaleBiasAxis ¶
func (o *MLCTensor) TensorByQuantizingToTypeScaleBiasAxis(type_ MLCDataType, scale *MLCTensor, bias *MLCTensor, axis int) *MLCTensor
Converts a 32-bit floating-point tensor with the scale and bias you specify.
type MLCTensorData ¶
type MLCTensorData struct {
foundation.NSObject
}
An encapsulation of the memory that tensor data uses.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctensordata
func MLCTensorDataDataWithBytesNoCopyLength ¶
func MLCTensorDataDataWithBytesNoCopyLength(bytes_ unsafe.Pointer, length uint) *MLCTensorData
Creates a tensor data instance with the buffer of data and length of bytes you specify.
func MLCTensorDataDataWithBytesNoCopyLengthDeallocator ¶
func MLCTensorDataDataWithBytesNoCopyLengthDeallocator(bytes_ unsafe.Pointer, length uint, deallocator func(unsafe.Pointer, uint)) *MLCTensorData
Creates a tensor data instance with a data buffer, byte length, and custom deallocator closure you specify.
func MLCTensorDataDataWithImmutableBytesNoCopyLength ¶
func MLCTensorDataDataWithImmutableBytesNoCopyLength(bytes_ unsafe.Pointer, length uint) *MLCTensorData
Creates a tensor data instance with the buffer of immutable data and length of bytes you specify.
func MLCTensorDataFromID ¶
func MLCTensorDataFromID(id objc.ID) *MLCTensorData
func (*MLCTensorData) Bytes ¶
func (o *MLCTensorData) Bytes() unsafe.Pointer
@property bytes @abstract Pointer to memory that contains or will be used for tensor data
func (*MLCTensorData) Length ¶
func (o *MLCTensorData) Length() uint
@property length @abstract The size in bytes of the tensor data
type MLCTensorDescriptor ¶
type MLCTensorDescriptor struct {
foundation.NSObject
}
A configuration object you use to create a tensor.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctensordescriptor
func MLCTensorDescriptorConvolutionBiasesDescriptorWithFeatureChannelCountDataType ¶
func MLCTensorDescriptorConvolutionBiasesDescriptorWithFeatureChannelCountDataType(featureChannelCount uint, dataType MLCDataType) *MLCTensorDescriptor
Creates a tensor descriptor with the number of feature channels and data type you specify.
func MLCTensorDescriptorConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType ¶
func MLCTensorDescriptorConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType(inputFeatureChannelCount uint, outputFeatureChannelCount uint, dataType MLCDataType) *MLCTensorDescriptor
Creates a tensor descriptor with the number of feature channels and data type you specify.
func MLCTensorDescriptorConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType ¶
func MLCTensorDescriptorConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType(width uint, height uint, inputFeatureChannelCount uint, outputFeatureChannelCount uint, dataType MLCDataType) *MLCTensorDescriptor
Creates a tensor descriptor with the sizing, number of feature channels, and data type you specify.
func MLCTensorDescriptorDescriptorWithShapeDataType ¶
func MLCTensorDescriptorDescriptorWithShapeDataType(shape *foundation.NSArray[*foundation.NSNumber], dataType MLCDataType) *MLCTensorDescriptor
Creates a tensor descriptor with the shape and data type you specify.
func MLCTensorDescriptorDescriptorWithShapeSequenceLengthsSortedSequencesDataType ¶
func MLCTensorDescriptorDescriptorWithShapeSequenceLengthsSortedSequencesDataType(shape *foundation.NSArray[*foundation.NSNumber], sequenceLengths *foundation.NSArray[*foundation.NSNumber], sortedSequences bool, dataType MLCDataType) *MLCTensorDescriptor
Creates a tensor descriptor with the shape, variable sequence lengths, sorting indicator, and data type you specify.
func MLCTensorDescriptorDescriptorWithWidthHeightFeatureChannelCountBatchSize ¶
func MLCTensorDescriptorDescriptorWithWidthHeightFeatureChannelCountBatchSize(width uint, height uint, featureChannels uint, batchSize uint) *MLCTensorDescriptor
Creates a tensor descriptor with the width and height, number of feature channels, and batch size you specify.
func MLCTensorDescriptorDescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType ¶
func MLCTensorDescriptorDescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType(width uint, height uint, featureChannelCount uint, batchSize uint, dataType MLCDataType) *MLCTensorDescriptor
Creates a tensor descriptor with the width and height, number of feature channels, batch size, and data type you specify.
func MLCTensorDescriptorFromID ¶
func MLCTensorDescriptorFromID(id objc.ID) *MLCTensorDescriptor
func (*MLCTensorDescriptor) BatchSizePerSequenceStep ¶
func (o *MLCTensorDescriptor) BatchSizePerSequenceStep() *foundation.NSArray[*foundation.NSNumber]
@property batchSizePerSequenceStep @abstract The batch size for each sequence @discussion We populate this only when sequenceLengths is valid. The length of this array should be the maximum sequence length in sequenceLengths (i.e sequenceLengths[0]).
func (*MLCTensorDescriptor) DataType ¶
func (o *MLCTensorDescriptor) DataType() MLCDataType
@property dataType @abstract The tensor data type. The default is MLCDataTypeFloat32.
func (*MLCTensorDescriptor) DimensionCount ¶
func (o *MLCTensorDescriptor) DimensionCount() uint
@property dimensionCount @abstract The number of dimensions in the tensor
func (*MLCTensorDescriptor) SequenceLengths ¶
func (o *MLCTensorDescriptor) SequenceLengths() *foundation.NSArray[*foundation.NSNumber]
@property sequenceLengths @abstract TODO
func (*MLCTensorDescriptor) Shape ¶
func (o *MLCTensorDescriptor) Shape() *foundation.NSArray[*foundation.NSNumber]
@property shape @abstract The size in each dimension
func (*MLCTensorDescriptor) SortedSequences ¶
func (o *MLCTensorDescriptor) SortedSequences() bool
@property sortedSequences @abstract Specifies whether the sequences are sorted or not.
func (*MLCTensorDescriptor) Stride ¶
func (o *MLCTensorDescriptor) Stride() *foundation.NSArray[*foundation.NSNumber]
@property stride @abstract The stride in bytes in each dimension
func (*MLCTensorDescriptor) TensorAllocationSizeInBytes ¶
func (o *MLCTensorDescriptor) TensorAllocationSizeInBytes() uint
@property tensorAllocationSizeInBytes @abstract The allocation size in bytes for a tensor.
type MLCTensorOptimizerDeviceData ¶
type MLCTensorOptimizerDeviceData struct {
foundation.NSObject
}
An encapsulation of the device memory associated with a tensor that an optimizer uses.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctensoroptimizerdevicedata
func MLCTensorOptimizerDeviceDataFromID ¶
func MLCTensorOptimizerDeviceDataFromID(id objc.ID) *MLCTensorOptimizerDeviceData
type MLCTensorParameter ¶
type MLCTensorParameter struct {
foundation.NSObject
}
A tensor parameter object.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctensorparameter
func MLCTensorParameterFromID ¶
func MLCTensorParameterFromID(id objc.ID) *MLCTensorParameter
func MLCTensorParameterParameterWithTensor ¶
func MLCTensorParameterParameterWithTensor(tensor *MLCTensor) *MLCTensorParameter
Creates a tensor parameter with the tensor you specify.
func MLCTensorParameterParameterWithTensorOptimizerData ¶
func MLCTensorParameterParameterWithTensorOptimizerData(tensor *MLCTensor, optimizerData *foundation.NSArray[*MLCTensorData]) *MLCTensorParameter
Creates a tensor parameter with the tensor and optimizer data you specify.
func (*MLCTensorParameter) IsUpdatable ¶
func (o *MLCTensorParameter) IsUpdatable() bool
@property isUpdatable @abstract Specifies whether this tensor parameter is updatable
func (*MLCTensorParameter) SetIsUpdatable ¶
func (o *MLCTensorParameter) SetIsUpdatable(isUpdatable bool)
func (*MLCTensorParameter) Tensor ¶
func (o *MLCTensorParameter) Tensor() *MLCTensor
@property tensor @abstract The underlying tensor
type MLCTrainingGraph ¶
type MLCTrainingGraph struct {
MLCGraph
}
A training graph that you create from one or more graph objects plus additional layers you add directly to the training graph.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctraininggraph
func MLCTrainingGraphFromID ¶
func MLCTrainingGraphFromID(id objc.ID) *MLCTrainingGraph
func MLCTrainingGraphGraphWithGraphObjectsLossLayerOptimizer ¶
func MLCTrainingGraphGraphWithGraphObjectsLossLayerOptimizer(graphObjects *foundation.NSArray[*MLCGraph], lossLayer *MLCLayer, optimizer *MLCOptimizer) *MLCTrainingGraph
Creates a training graph with the layers from the graph objects, loss layer, and optimizer you specify.
func (*MLCTrainingGraph) AddInputsLossLabels ¶
func (o *MLCTrainingGraph) AddInputsLossLabels(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor], lossLabels *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
Adds the inputs and loss label inputs that you specify to the training graph.
func (*MLCTrainingGraph) AddInputsLossLabelsLossLabelWeights ¶
func (o *MLCTrainingGraph) AddInputsLossLabelsLossLabelWeights(inputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor], lossLabels *foundation.NSDictionary[*foundation.NSString, *MLCTensor], lossLabelWeights *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
Adds the inputs, loss labels, and loss label weights that you specify to the training graph.
func (*MLCTrainingGraph) AddOutputs ¶
func (o *MLCTrainingGraph) AddOutputs(outputs *foundation.NSDictionary[*foundation.NSString, *MLCTensor]) bool
Adds the outputs to the training graph you specify.
func (*MLCTrainingGraph) AllocateUserGradientForTensor ¶
func (o *MLCTrainingGraph) AllocateUserGradientForTensor(tensor *MLCTensor) *MLCTensor
Allocates an entry for a gradient for the result tensor you specify.
func (*MLCTrainingGraph) BindOptimizerDataDeviceDataWithTensor ¶
func (o *MLCTrainingGraph) BindOptimizerDataDeviceDataWithTensor(data *foundation.NSArray[*MLCTensorData], deviceData *foundation.NSArray[*MLCTensorOptimizerDeviceData], tensor *MLCTensor) bool
Associates the optimizer and device data you specify along with the tensor.
func (*MLCTrainingGraph) CompileOptimizer ¶
func (o *MLCTrainingGraph) CompileOptimizer(optimizer *MLCOptimizer) bool
Compiles the optimizer to use with a training graph you specify.
func (*MLCTrainingGraph) CompileWithOptionsDevice ¶
func (o *MLCTrainingGraph) CompileWithOptionsDevice(options MLCGraphCompilationOptions, device *MLCDevice) bool
Compiles the training graph for the options and device you specify.
func (*MLCTrainingGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData ¶
func (o *MLCTrainingGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options MLCGraphCompilationOptions, device *MLCDevice, inputTensors *foundation.NSDictionary[*foundation.NSString, *MLCTensor], inputTensorsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData]) bool
Compiles the training graph for the options, device, and input tensors you specify.
func (*MLCTrainingGraph) DeviceMemorySize ¶
func (o *MLCTrainingGraph) DeviceMemorySize() uint
@property The device memory size used by the training graph @abstract Returns the total size in bytes of device memory used for all intermediate tensors for forward, gradient passes and optimizer update for all layers in the training graph. We recommend executing an iteration before checking the device memory size as the buffers needed get allocated when the corresponding pass such as gradient, optimizer update is executed. @return A NSUInteger value
func (*MLCTrainingGraph) ExecuteForwardWithBatchSizeOptionsCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteForwardWithBatchSizeOptionsCompletionHandler(batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the forward pass of the training graph with the batch size, execution options, and completion handler you specify.
func (*MLCTrainingGraph) ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize uint, options MLCExecutionOptions, outputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the forward pass of the training graph with the batch size, execution options, output data, and completion handler you specify.
func (*MLCTrainingGraph) ExecuteGradientWithBatchSizeOptionsCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteGradientWithBatchSizeOptionsCompletionHandler(batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the gradient pass of the training graph with the batch size, execution options, and completion handler you specify.
func (*MLCTrainingGraph) ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize uint, options MLCExecutionOptions, outputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the gradient pass of the training graph with the batch size, execution options, output data, and completion handler you specify.
func (*MLCTrainingGraph) ExecuteOptimizerUpdateWithOptionsCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteOptimizerUpdateWithOptionsCompletionHandler(options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the optimizer update pass of the training graph with the execution options and completion handler you specify.
func (*MLCTrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelWeightsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the training graph with the input data, batch size, execution options, and completion handler you specify.
func (*MLCTrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler ¶
func (o *MLCTrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], lossLabelWeightsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], outputsData *foundation.NSDictionary[*foundation.NSString, *MLCTensorData], batchSize uint, options MLCExecutionOptions, completionHandler func(*MLCTensor, unsafe.Pointer, float64)) bool
Executes the training graph with the input data, output data, batch size, execution options, and completion handler that you specify.
func (*MLCTrainingGraph) GradientDataForParameterLayer ¶
func (o *MLCTrainingGraph) GradientDataForParameterLayer(parameter *MLCTensor, layer *MLCLayer) *foundation.NSData
Gets the gradient data for the trainable parameter and associated layer you specify.
func (*MLCTrainingGraph) GradientTensorForInput ¶
func (o *MLCTrainingGraph) GradientTensorForInput(input *MLCTensor) *MLCTensor
Gets the gradient tensor for the input tensor you specify.
func (*MLCTrainingGraph) LinkWithGraphs ¶
func (o *MLCTrainingGraph) LinkWithGraphs(graphs *foundation.NSArray[*MLCTrainingGraph]) bool
Links the training graphs you specify.
func (*MLCTrainingGraph) Optimizer ¶
func (o *MLCTrainingGraph) Optimizer() *MLCOptimizer
@property optimizer @abstract The optimizer to be used with the training graph
func (*MLCTrainingGraph) ResultGradientTensorsForLayer ¶
func (o *MLCTrainingGraph) ResultGradientTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
Gets the result gradient tensors for the layer in the training graph you specify.
func (*MLCTrainingGraph) SetTrainingTensorParameters ¶
func (o *MLCTrainingGraph) SetTrainingTensorParameters(parameters *foundation.NSArray[*MLCTensorParameter]) bool
Sets the input tensor parameters, which the optimizer then updates.
func (*MLCTrainingGraph) SourceGradientTensorsForLayer ¶
func (o *MLCTrainingGraph) SourceGradientTensorsForLayer(layer *MLCLayer) *foundation.NSArray[*MLCTensor]
Gets the source gradient tensors for the layer in the training graph you specify.
func (*MLCTrainingGraph) StopGradientForTensors ¶
func (o *MLCTrainingGraph) StopGradientForTensors(tensors *foundation.NSArray[*MLCTensor]) bool
Adds the tensors that you specify, to indicate which contributions the graph excludes when computing gradients during gradient pass.
func (*MLCTrainingGraph) SynchronizeUpdates ¶
func (o *MLCTrainingGraph) SynchronizeUpdates()
Synchronizes updates from device memory.
type MLCTransposeLayer ¶
type MLCTransposeLayer struct {
MLCLayer
}
A layer that permutes the dimensions you specify.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlctransposelayer
func MLCTransposeLayerFromID ¶
func MLCTransposeLayerFromID(id objc.ID) *MLCTransposeLayer
func MLCTransposeLayerLayerWithDimensions ¶
func MLCTransposeLayerLayerWithDimensions(dimensions *foundation.NSArray[*foundation.NSNumber]) *MLCTransposeLayer
Creates a transpose layer with the dimensions you specify.
func (*MLCTransposeLayer) Dimensions ¶
func (o *MLCTransposeLayer) Dimensions() *foundation.NSArray[*foundation.NSNumber]
@property dimensions @abstract Permutes the dimensions according to 'dimensions'. @discussion The returned tensor's dimension i will correspond to dimensions[i].
type MLCUpsampleLayer ¶
type MLCUpsampleLayer struct {
MLCLayer
}
A layer that applies upsampling with the shape you specify.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcupsamplelayer
func MLCUpsampleLayerFromID ¶
func MLCUpsampleLayerFromID(id objc.ID) *MLCUpsampleLayer
func MLCUpsampleLayerLayerWithShape ¶
func MLCUpsampleLayerLayerWithShape(shape *foundation.NSArray[*foundation.NSNumber]) *MLCUpsampleLayer
Creates an upsample layer with the shape you specify.
func MLCUpsampleLayerLayerWithShapeSampleModeAlignsCorners ¶
func MLCUpsampleLayerLayerWithShapeSampleModeAlignsCorners(shape *foundation.NSArray[*foundation.NSNumber], sampleMode MLCSampleMode, alignsCorners bool) *MLCUpsampleLayer
Creates an upsample layer with the shape, upsampling algorithm, and corner alignement option you specify.
func (*MLCUpsampleLayer) AlignsCorners ¶
func (o *MLCUpsampleLayer) AlignsCorners() bool
@property alignsCorners @abstract A boolean that specifies whether the corner pixels of the source and result tensors are aligned. @discussion If True, the corner pixels of the source and result tensors are aligned, and thus preserving the values at those pixels. This only has effect when mode is 'bilinear'. Default is NO.
func (*MLCUpsampleLayer) SampleMode ¶
func (o *MLCUpsampleLayer) SampleMode() MLCSampleMode
@property sampleMode @abstract The sampling mode to use when performing the upsample.
func (*MLCUpsampleLayer) Shape ¶
func (o *MLCUpsampleLayer) Shape() *foundation.NSArray[*foundation.NSNumber]
@property shape @abstract A NSArray<NSNumber *> representing just the width if number of entries in shape array is 1 or the height followed by width of result tensor if the number of entries in shape array is 2.
type MLCYOLOLossDescriptor ¶
type MLCYOLOLossDescriptor struct {
foundation.NSObject
}
The configuration object you use to create the YOLO loss layer.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcyololossdescriptor
func MLCYOLOLossDescriptorDescriptorWithAnchorBoxesAnchorBoxCount ¶
func MLCYOLOLossDescriptorDescriptorWithAnchorBoxesAnchorBoxCount(anchorBoxes *foundation.NSData, anchorBoxCount uint) *MLCYOLOLossDescriptor
Creates a YOLO loss filter descriptor with the anchor box data and number of anchor boxes you specify.
func MLCYOLOLossDescriptorFromID ¶
func MLCYOLOLossDescriptorFromID(id objc.ID) *MLCYOLOLossDescriptor
func (*MLCYOLOLossDescriptor) AnchorBoxCount ¶
func (o *MLCYOLOLossDescriptor) AnchorBoxCount() uint
@property anchorBoxCount @abstract number of anchor boxes used to detect object per grid cell
func (*MLCYOLOLossDescriptor) AnchorBoxes ¶
func (o *MLCYOLOLossDescriptor) AnchorBoxes() *foundation.NSData
@property anchorBoxes @abstract \p NSData containing the width and height for \p anchorBoxCount anchor boxes This \p NSData should have 2 floating-point values per anchor box which represent the width and height of the anchor box.
func (*MLCYOLOLossDescriptor) MaximumIOUForObjectAbsence ¶
func (o *MLCYOLOLossDescriptor) MaximumIOUForObjectAbsence() float32
@property negative IOU @abstract If the prediction IOU with groundTruth is lower than this value we consider it a confident object absence. The default is 0.3
func (*MLCYOLOLossDescriptor) MinimumIOUForObjectPresence ¶
func (o *MLCYOLOLossDescriptor) MinimumIOUForObjectPresence() float32
@property positive IOU @abstract If the prediction IOU with groundTruth is higher than this value we consider it a confident object presence, The default is 0.7
func (*MLCYOLOLossDescriptor) ScaleClassLoss ¶
func (o *MLCYOLOLossDescriptor) ScaleClassLoss() float32
@property scaleClass @abstract The scale factor for no object classes loss and loss gradient. The default is 2.0
func (*MLCYOLOLossDescriptor) ScaleNoObjectConfidenceLoss ¶
func (o *MLCYOLOLossDescriptor) ScaleNoObjectConfidenceLoss() float32
@property scaleNoObject @abstract The scale factor for no object confidence loss and loss gradient. The default is 5.0
func (*MLCYOLOLossDescriptor) ScaleObjectConfidenceLoss ¶
func (o *MLCYOLOLossDescriptor) ScaleObjectConfidenceLoss() float32
@property scaleObject @abstract The scale factor for object confidence loss and loss gradient. The default is 100.0
func (*MLCYOLOLossDescriptor) ScaleSpatialPositionLoss ¶
func (o *MLCYOLOLossDescriptor) ScaleSpatialPositionLoss() float32
@property scaleSpatialPositionLoss @abstract The scale factor for spatial position loss and loss gradient. The default is 10.0
func (*MLCYOLOLossDescriptor) ScaleSpatialSizeLoss ¶
func (o *MLCYOLOLossDescriptor) ScaleSpatialSizeLoss() float32
@property scaleSpatialSizeLoss @abstract The scale factor for spatial size loss and loss gradient. The default is 10.0
func (*MLCYOLOLossDescriptor) SetMaximumIOUForObjectAbsence ¶
func (o *MLCYOLOLossDescriptor) SetMaximumIOUForObjectAbsence(maximumIOUForObjectAbsence float32)
func (*MLCYOLOLossDescriptor) SetMinimumIOUForObjectPresence ¶
func (o *MLCYOLOLossDescriptor) SetMinimumIOUForObjectPresence(minimumIOUForObjectPresence float32)
func (*MLCYOLOLossDescriptor) SetScaleClassLoss ¶
func (o *MLCYOLOLossDescriptor) SetScaleClassLoss(scaleClassLoss float32)
func (*MLCYOLOLossDescriptor) SetScaleNoObjectConfidenceLoss ¶
func (o *MLCYOLOLossDescriptor) SetScaleNoObjectConfidenceLoss(scaleNoObjectConfidenceLoss float32)
func (*MLCYOLOLossDescriptor) SetScaleObjectConfidenceLoss ¶
func (o *MLCYOLOLossDescriptor) SetScaleObjectConfidenceLoss(scaleObjectConfidenceLoss float32)
func (*MLCYOLOLossDescriptor) SetScaleSpatialPositionLoss ¶
func (o *MLCYOLOLossDescriptor) SetScaleSpatialPositionLoss(scaleSpatialPositionLoss float32)
func (*MLCYOLOLossDescriptor) SetScaleSpatialSizeLoss ¶
func (o *MLCYOLOLossDescriptor) SetScaleSpatialSizeLoss(scaleSpatialSizeLoss float32)
func (*MLCYOLOLossDescriptor) SetShouldRescore ¶
func (o *MLCYOLOLossDescriptor) SetShouldRescore(shouldRescore bool)
func (*MLCYOLOLossDescriptor) ShouldRescore ¶
func (o *MLCYOLOLossDescriptor) ShouldRescore() bool
@property shouldRescore @abstract Rescore pertains to multiplying the confidence groundTruth with IOU (intersection over union) of predicted bounding box and the groundTruth boundingBox. The default is YES
type MLCYOLOLossLayer ¶
type MLCYOLOLossLayer struct {
MLCLossLayer
}
A layer that estimates loss for the YOLO algorithm.
Apple documentation: https://developer.apple.com/documentation/mlcompute/mlcyololosslayer
func MLCYOLOLossLayerFromID ¶
func MLCYOLOLossLayerFromID(id objc.ID) *MLCYOLOLossLayer
func MLCYOLOLossLayerLayerWithDescriptor ¶
func MLCYOLOLossLayerLayerWithDescriptor(lossDescriptor *MLCYOLOLossDescriptor) *MLCYOLOLossLayer
Creates a YOLO loss layer with the descriptor you specify.
func (*MLCYOLOLossLayer) YoloLossDescriptor ¶
func (o *MLCYOLOLossLayer) YoloLossDescriptor() *MLCYOLOLossDescriptor
@property yoloLossDescriptor @abstract The YOLO loss descriptor
type Mach_vm_range_flags_t ¶
type Mach_vm_range_flags_t int64
const (
MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)
func (Mach_vm_range_flags_t) String ¶
func (e Mach_vm_range_flags_t) String() string
type Mach_vm_range_flavor_t ¶
type Mach_vm_range_flavor_t int64
const ( MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0 MACH_VM_RANGE_FLAVOR_V1 Mach_vm_range_flavor_t = 1 )
func (Mach_vm_range_flavor_t) String ¶
func (e Mach_vm_range_flavor_t) String() string
type Mach_vm_range_tag_t ¶
type Mach_vm_range_tag_t int64
const ( MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0 MACH_VM_RANGE_DATA Mach_vm_range_tag_t = 1 MACH_VM_RANGE_FIXED Mach_vm_range_tag_t = 2 )
func (Mach_vm_range_tag_t) String ¶
func (e Mach_vm_range_tag_t) String() string
type Mpo_flags_t ¶
type Mpo_flags_t int64
const ( MPO_PORT Mpo_flags_t = 0 MPO_SERVICE_PORT Mpo_flags_t = 1024 MPO_CONNECTION_PORT Mpo_flags_t = 2048 MPO_REPLY_PORT Mpo_flags_t = 4096 MPO_WEAK_REPLY_PORT Mpo_flags_t = 16384 MPO_NOTIFICATION_PORT Mpo_flags_t = 17408 MPO_EXCEPTION_PORT Mpo_flags_t = 32768 MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536 )
func (Mpo_flags_t) String ¶
func (e Mpo_flags_t) String() string
type Os_clockid_t ¶
type Os_clockid_t int64
const (
OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)
func (Os_clockid_t) String ¶
func (e Os_clockid_t) String() string
type Ptrauth_key ¶
type Ptrauth_key int64
const ( Ptrauth_key_none Ptrauth_key = -1 Ptrauth_key_asia Ptrauth_key = 0 Ptrauth_key_asib Ptrauth_key = 1 Ptrauth_key_asda Ptrauth_key = 2 Ptrauth_key_asdb Ptrauth_key = 3 Ptrauth_key_process_independent_code Ptrauth_key = 0 Ptrauth_key_process_dependent_code Ptrauth_key = 1 Ptrauth_key_process_independent_data Ptrauth_key = 2 Ptrauth_key_process_dependent_data Ptrauth_key = 3 Ptrauth_key_return_address Ptrauth_key = 1 Ptrauth_key_frame_pointer Ptrauth_key = 3 Ptrauth_key_function_pointer Ptrauth_key = 0 Ptrauth_key_block_function Ptrauth_key = 0 Ptrauth_key_cxx_vtable_pointer Ptrauth_key = 2 Ptrauth_key_method_list_pointer Ptrauth_key = 2 Ptrauth_key_objc_isa_pointer Ptrauth_key = 2 Ptrauth_key_objc_super_pointer Ptrauth_key = 2 Ptrauth_key_objc_sel_pointer Ptrauth_key = 3 Ptrauth_key_objc_class_ro_pointer Ptrauth_key = 2 Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2 Ptrauth_key_init_fini_pointer Ptrauth_key = 0 )
func (Ptrauth_key) String ¶
func (e Ptrauth_key) String() string
type Qos_class_t ¶
type Qos_class_t uint32
const ( QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33 QOS_CLASS_USER_INITIATED Qos_class_t = 25 QOS_CLASS_DEFAULT Qos_class_t = 21 QOS_CLASS_UTILITY Qos_class_t = 17 QOS_CLASS_BACKGROUND Qos_class_t = 9 QOS_CLASS_UNSPECIFIED Qos_class_t = 0 )
func (Qos_class_t) String ¶
func (e Qos_class_t) String() string
type Virtual_memory_guard_exception_code_t ¶
type Virtual_memory_guard_exception_code_t int64
const ( KGUARD_EXC_DEALLOC_GAP Virtual_memory_guard_exception_code_t = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE Virtual_memory_guard_exception_code_t = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE Virtual_memory_guard_exception_code_t = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE Virtual_memory_guard_exception_code_t = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE Virtual_memory_guard_exception_code_t = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE Virtual_memory_guard_exception_code_t = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE Virtual_memory_guard_exception_code_t = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION Virtual_memory_guard_exception_code_t = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY Virtual_memory_guard_exception_code_t = 13 KGUARD_EXC_SEC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 99 KGUARD_EXC_SEC_COPY_DENIED Virtual_memory_guard_exception_code_t = 100 KGUARD_EXC_SEC_SHARING_DENIED Virtual_memory_guard_exception_code_t = 101 KGUARD_EXC_MTE_SYNC_FAULT Virtual_memory_guard_exception_code_t = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204 )
func (Virtual_memory_guard_exception_code_t) String ¶
func (e Virtual_memory_guard_exception_code_t) String() string
type Xpc_listener_create_flags_t ¶
type Xpc_listener_create_flags_t int64
const ( XPC_LISTENER_CREATE_NONE Xpc_listener_create_flags_t = 0 XPC_LISTENER_CREATE_INACTIVE Xpc_listener_create_flags_t = 1 XPC_LISTENER_CREATE_FORCE_MACH Xpc_listener_create_flags_t = 2 XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4 )
func (Xpc_listener_create_flags_t) String ¶
func (e Xpc_listener_create_flags_t) String() string
type Xpc_session_create_flags_t ¶
type Xpc_session_create_flags_t int64
const ( XPC_SESSION_CREATE_NONE Xpc_session_create_flags_t = 0 XPC_SESSION_CREATE_INACTIVE Xpc_session_create_flags_t = 1 XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2 )
func (Xpc_session_create_flags_t) String ¶
func (e Xpc_session_create_flags_t) String() string
Source Files
¶
- MLCActivationDescriptor.go
- MLCActivationLayer.go
- MLCAdamOptimizer.go
- MLCAdamWOptimizer.go
- MLCArithmeticLayer.go
- MLCBatchNormalizationLayer.go
- MLCComparisonLayer.go
- MLCConcatenationLayer.go
- MLCConvolutionDescriptor.go
- MLCConvolutionLayer.go
- MLCDevice.go
- MLCDropoutLayer.go
- MLCEmbeddingDescriptor.go
- MLCEmbeddingLayer.go
- MLCFullyConnectedLayer.go
- MLCGatherLayer.go
- MLCGramMatrixLayer.go
- MLCGraph.go
- MLCGroupNormalizationLayer.go
- MLCInferenceGraph.go
- MLCInstanceNormalizationLayer.go
- MLCLSTMDescriptor.go
- MLCLSTMLayer.go
- MLCLayer.go
- MLCLayerNormalizationLayer.go
- MLCLossDescriptor.go
- MLCLossLayer.go
- MLCMatMulDescriptor.go
- MLCMatMulLayer.go
- MLCMultiheadAttentionDescriptor.go
- MLCMultiheadAttentionLayer.go
- MLCOptimizer.go
- MLCOptimizerDescriptor.go
- MLCPaddingLayer.go
- MLCPlatform.go
- MLCPoolingDescriptor.go
- MLCPoolingLayer.go
- MLCRMSPropOptimizer.go
- MLCReductionLayer.go
- MLCReshapeLayer.go
- MLCSGDOptimizer.go
- MLCScatterLayer.go
- MLCSelectionLayer.go
- MLCSliceLayer.go
- MLCSoftmaxLayer.go
- MLCSplitLayer.go
- MLCTensor.go
- MLCTensorData.go
- MLCTensorDescriptor.go
- MLCTensorOptimizerDeviceData.go
- MLCTensorParameter.go
- MLCTrainingGraph.go
- MLCTransposeLayer.go
- MLCUpsampleLayer.go
- MLCYOLOLossDescriptor.go
- MLCYOLOLossLayer.go
- doc.go
- mlcompute_enums.go
- mlcompute_functions.go
- mlcompute_runtime.go