Documentation
¶
Overview ¶
Package mlcompute provides a fluent Go API over the macOS MLCompute framework.
Construction ¶
New… functions create objects; each With… method sets one property and returns its receiver, so configuration calls chain. A <Type>FromID constructor adopts an Objective-C object obtained elsewhere.
Lifecycle ¶
A wrapper releases its Objective-C object automatically once the garbage collector finds it unreachable. Call Release to relinquish the reference deterministically (for objects holding scarce resources); Release is idempotent, and afterwards the wrapper's methods are no-ops returning zero values.
Types ¶
Each base type below lists the concrete types you construct and pass where the base is accepted:
- Graph: InferenceGraph, TrainingGraph
- Layer: ActivationLayer, ArithmeticLayer, BatchNormalizationLayer, ComparisonLayer, ConcatenationLayer, ConvolutionLayer, DropoutLayer, EmbeddingLayer, FullyConnectedLayer, GatherLayer, GramMatrixLayer, GroupNormalizationLayer, InstanceNormalizationLayer, LSTMLayer, LayerNormalizationLayer, LossLayer, MatMulLayer, MultiheadAttentionLayer, PaddingLayer, PoolingLayer, ReductionLayer, ReshapeLayer, ScatterLayer, SelectionLayer, SliceLayer, SoftmaxLayer, SplitLayer, TransposeLayer, UpsampleLayer
- LossLayer: YOLOLossLayer
- Optimizer: AdamOptimizer, AdamWOptimizer, RMSPropOptimizer, SGDOptimizer
Index ¶
- func GetRNGseed() *foundation.Number
- func MLCActivationTypeDebugDescription(activationType ActivationType) string
- func MLCArithmeticOperationDebugDescription(operation ArithmeticOperation) string
- func MLCComparisonOperationDebugDescription(operation ComparisonOperation) string
- func MLCConvolutionTypeDebugDescription(convolutionType ConvolutionType) string
- func MLCGradientClippingTypeDebugDescription(gradientClippingType GradientClippingType) string
- func MLCLSTMResultModeDebugDescription(mode LSTMResultMode) string
- func MLCLossTypeDebugDescription(lossType LossType) string
- func MLCPaddingPolicyDebugDescription(paddingPolicy PaddingPolicy) string
- func MLCPaddingTypeDebugDescription(paddingType PaddingType) string
- func MLCPoolingTypeDebugDescription(poolingType PoolingType) string
- func MLCReductionTypeDebugDescription(reductionType ReductionType) string
- func MLCSampleModeDebugDescription(mode SampleMode) string
- func MLCSoftmaxOperationDebugDescription(operation SoftmaxOperation) string
- func MaxTensorDimensions() int
- func SetRNGSeedTo(seed obj.Object)
- func SupportsDataTypeOnDevice(dataType DataType, device *Device) bool
- type ActivationDescriptor
- func ActivationDescriptorFromID(id objc.ID) *ActivationDescriptor
- func DescriptorWithType(activationType ActivationType) *ActivationDescriptor
- func DescriptorWithTypeA(activationType ActivationType, a float32) *ActivationDescriptor
- func DescriptorWithTypeAB(activationType ActivationType, a float32, b float32) *ActivationDescriptor
- func DescriptorWithTypeABC(activationType ActivationType, a float32, b float32, c float32) *ActivationDescriptor
- func NewActivationDescriptor() *ActivationDescriptor
- func (ad *ActivationDescriptor) A() float32
- func (ad *ActivationDescriptor) ActivationType() ActivationType
- func (ad *ActivationDescriptor) B() float32
- func (ad *ActivationDescriptor) C() float32
- func (ad *ActivationDescriptor) Description() string
- func (ad *ActivationDescriptor) IsEqual(other obj.Object) bool
- func (ad *ActivationDescriptor) IsKind(className string) bool
- func (ad *ActivationDescriptor) String() string
- type ActivationLayer
- func AbsoluteLayer() *ActivationLayer
- func ActivationLayerFromID(id objc.ID) *ActivationLayer
- func CeluLayer() *ActivationLayer
- func CeluLayerWithA(a float32) *ActivationLayer
- func ClampLayerWithMinValueMaxValue(minValue float32, maxValue float32) *ActivationLayer
- func EluLayer() *ActivationLayer
- func EluLayerWithA(a float32) *ActivationLayer
- func GeluLayer() *ActivationLayer
- func HardShrinkLayer() *ActivationLayer
- func HardShrinkLayerWithA(a float32) *ActivationLayer
- func HardSigmoidLayer() *ActivationLayer
- func HardSwishLayer() *ActivationLayer
- func LayerWithDescriptor(descriptor *ActivationDescriptor) *ActivationLayer
- func LeakyReLULayer() *ActivationLayer
- func LeakyReLULayerWithNegativeSlope(negativeSlope float32) *ActivationLayer
- func LinearLayerWithScaleBias(scale float32, bias float32) *ActivationLayer
- func LogSigmoidLayer() *ActivationLayer
- func NewActivationLayer() *ActivationLayer
- func Relu6Layer() *ActivationLayer
- func ReluLayer() *ActivationLayer
- func RelunLayerWithAB(a float32, b float32) *ActivationLayer
- func SeluLayer() *ActivationLayer
- func SigmoidLayer() *ActivationLayer
- func SoftPlusLayer() *ActivationLayer
- func SoftPlusLayerWithBeta(beta float32) *ActivationLayer
- func SoftShrinkLayer() *ActivationLayer
- func SoftShrinkLayerWithA(a float32) *ActivationLayer
- func SoftSignLayer() *ActivationLayer
- func TanhLayer() *ActivationLayer
- func TanhShrinkLayer() *ActivationLayer
- func ThresholdLayerWithThresholdReplacement(threshold float32, replacement float32) *ActivationLayer
- type ActivationType
- type AdamOptimizer
- func AdamOptimizerFromID(id objc.ID) *AdamOptimizer
- func NewAdamOptimizer() *AdamOptimizer
- func OptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *AdamOptimizer
- func OptimizerWithDescriptorBeta1Beta2EpsilonTimeStep(optimizerDescriptor *OptimizerDescriptor, beta1 float32, beta2 float32, ...) *AdamOptimizer
- func OptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *OptimizerDescriptor, beta1 float32, beta2 float32, ...) *AdamOptimizer
- func (ao *AdamOptimizer) Beta1() float32
- func (ao *AdamOptimizer) Beta2() float32
- func (ao *AdamOptimizer) Epsilon() float32
- func (ao *AdamOptimizer) TimeStep() int
- func (ao *AdamOptimizer) UsesAMSGrad() bool
- func (ao *AdamOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *AdamOptimizer
- func (ao *AdamOptimizer) WithLearningRate(learningRate float32) *AdamOptimizer
- type AdamWOptimizer
- func AdamWOptimizerFromID(id objc.ID) *AdamWOptimizer
- func MLCAdamWOptimizerOptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *AdamWOptimizer
- func MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *OptimizerDescriptor, beta1 float32, beta2 float32, ...) *AdamWOptimizer
- func NewAdamWOptimizer() *AdamWOptimizer
- func (awo *AdamWOptimizer) Beta1() float32
- func (awo *AdamWOptimizer) Beta2() float32
- func (awo *AdamWOptimizer) Epsilon() float32
- func (awo *AdamWOptimizer) TimeStep() int
- func (awo *AdamWOptimizer) UsesAMSGrad() bool
- func (awo *AdamWOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *AdamWOptimizer
- func (awo *AdamWOptimizer) WithLearningRate(learningRate float32) *AdamWOptimizer
- type ArithmeticLayer
- type ArithmeticOperation
- type BatchNormalizationLayer
- func BatchNormalizationLayerFromID(id objc.ID) *BatchNormalizationLayer
- func LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon(featureChannelCount int, mean *Tensor, variance *Tensor, beta *Tensor, ...) *BatchNormalizationLayer
- func LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount int, mean *Tensor, variance *Tensor, beta *Tensor, ...) *BatchNormalizationLayer
- func NewBatchNormalizationLayer() *BatchNormalizationLayer
- func (bnl *BatchNormalizationLayer) Beta() *Tensor
- func (bnl *BatchNormalizationLayer) BetaParameter() *TensorParameter
- func (bnl *BatchNormalizationLayer) FeatureChannelCount() int
- func (bnl *BatchNormalizationLayer) Gamma() *Tensor
- func (bnl *BatchNormalizationLayer) GammaParameter() *TensorParameter
- func (bnl *BatchNormalizationLayer) Mean() *Tensor
- func (bnl *BatchNormalizationLayer) Momentum() float32
- func (bnl *BatchNormalizationLayer) Variance() *Tensor
- func (bnl *BatchNormalizationLayer) VarianceEpsilon() float32
- func (bnl *BatchNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *BatchNormalizationLayer
- func (bnl *BatchNormalizationLayer) WithLabel(label string) *BatchNormalizationLayer
- type Clockid
- type ComparisonLayer
- type ComparisonOperation
- type ConcatenationLayer
- type ConvolutionDescriptor
- func ConvolutionDescriptorFromID(id objc.ID) *ConvolutionDescriptor
- func ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func ConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth int, kernelHeight int, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier(kernelWidth int, kernelHeight int, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth int, kernelHeight int, inputFeatureChannelCount int, ...) *ConvolutionDescriptor
- func DescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(convolutionType ConvolutionType, kernelSizes []*foundation.Number, ...) *ConvolutionDescriptor
- func NewConvolutionDescriptor() *ConvolutionDescriptor
- func (cd *ConvolutionDescriptor) ConvolutionType() ConvolutionType
- func (cd *ConvolutionDescriptor) Description() string
- func (cd *ConvolutionDescriptor) DilationRateInX() int
- func (cd *ConvolutionDescriptor) DilationRateInY() int
- func (cd *ConvolutionDescriptor) GroupCount() int
- func (cd *ConvolutionDescriptor) InputFeatureChannelCount() int
- func (cd *ConvolutionDescriptor) IsConvolutionTranspose() bool
- func (cd *ConvolutionDescriptor) IsEqual(other obj.Object) bool
- func (cd *ConvolutionDescriptor) IsKind(className string) bool
- func (cd *ConvolutionDescriptor) KernelHeight() int
- func (cd *ConvolutionDescriptor) KernelWidth() int
- func (cd *ConvolutionDescriptor) OutputFeatureChannelCount() int
- func (cd *ConvolutionDescriptor) PaddingPolicy() PaddingPolicy
- func (cd *ConvolutionDescriptor) PaddingSizeInX() int
- func (cd *ConvolutionDescriptor) PaddingSizeInY() int
- func (cd *ConvolutionDescriptor) StrideInX() int
- func (cd *ConvolutionDescriptor) StrideInY() int
- func (cd *ConvolutionDescriptor) String() string
- func (cd *ConvolutionDescriptor) UsesDepthwiseConvolution() bool
- type ConvolutionLayer
- func (cl *ConvolutionLayer) Biases() *Tensor
- func (cl *ConvolutionLayer) BiasesParameter() *TensorParameter
- func (cl *ConvolutionLayer) Descriptor() *ConvolutionDescriptor
- func (cl *ConvolutionLayer) Weights() *Tensor
- func (cl *ConvolutionLayer) WeightsParameter() *TensorParameter
- func (cl *ConvolutionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ConvolutionLayer
- func (cl *ConvolutionLayer) WithLabel(label string) *ConvolutionLayer
- type ConvolutionType
- type DataType
- type Device
- func AneDevice() *Device
- func CpuDevice() *Device
- func DeviceFromID(id objc.ID) *Device
- func DeviceWithGPUDevices(gpus []obj.Object) *Device
- func DeviceWithType(type_ DeviceType) *Device
- func DeviceWithTypeSelectsMultipleComputeDevices(type_ DeviceType, selectsMultipleComputeDevices bool) *Device
- func GpuDevice() *Device
- func NewDevice() *Device
- type DeviceType
- type DispatchAutoreleaseFrequency
- type DispatchBlockFlags
- type DropoutLayer
- type EmbeddingDescriptor
- func DescriptorWithEmbeddingCountEmbeddingDimension(embeddingCount obj.Object, embeddingDimension obj.Object) *EmbeddingDescriptor
- func DescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency(embeddingCount obj.Object, embeddingDimension obj.Object, ...) *EmbeddingDescriptor
- func EmbeddingDescriptorFromID(id objc.ID) *EmbeddingDescriptor
- func NewEmbeddingDescriptor() *EmbeddingDescriptor
- func (ed *EmbeddingDescriptor) Description() string
- func (ed *EmbeddingDescriptor) EmbeddingCount() *foundation.Number
- func (ed *EmbeddingDescriptor) EmbeddingDimension() *foundation.Number
- func (ed *EmbeddingDescriptor) IsEqual(other obj.Object) bool
- func (ed *EmbeddingDescriptor) IsKind(className string) bool
- func (ed *EmbeddingDescriptor) MaximumNorm() *foundation.Number
- func (ed *EmbeddingDescriptor) PNorm() *foundation.Number
- func (ed *EmbeddingDescriptor) PaddingIndex() *foundation.Number
- func (ed *EmbeddingDescriptor) ScalesGradientByFrequency() bool
- func (ed *EmbeddingDescriptor) String() string
- type EmbeddingLayer
- func (el *EmbeddingLayer) Descriptor() *EmbeddingDescriptor
- func (el *EmbeddingLayer) Weights() *Tensor
- func (el *EmbeddingLayer) WeightsParameter() *TensorParameter
- func (el *EmbeddingLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *EmbeddingLayer
- func (el *EmbeddingLayer) WithLabel(label string) *EmbeddingLayer
- type EntryID
- type ExecutionOptions
- type FilesecProperty
- type Flag
- type FullyConnectedLayer
- func (fcl *FullyConnectedLayer) Biases() *Tensor
- func (fcl *FullyConnectedLayer) BiasesParameter() *TensorParameter
- func (fcl *FullyConnectedLayer) Descriptor() *ConvolutionDescriptor
- func (fcl *FullyConnectedLayer) Weights() *Tensor
- func (fcl *FullyConnectedLayer) WeightsParameter() *TensorParameter
- func (fcl *FullyConnectedLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *FullyConnectedLayer
- func (fcl *FullyConnectedLayer) WithLabel(label string) *FullyConnectedLayer
- type GatherLayer
- type GradientClippingType
- type GramMatrixLayer
- type Graph
- func (g *Graph) BindAndWriteDataForInputsToDeviceBatchSizeSynchronous(inputsData map[string]*TensorData, inputTensors map[string]*Tensor, ...) bool
- func (g *Graph) BindAndWriteDataForInputsToDeviceSynchronous(inputsData map[string]*TensorData, inputTensors map[string]*Tensor, ...) bool
- func (g *Graph) ConcatenateWithSourcesDimension(sources []*Tensor, dimension int) *Tensor
- func (g *Graph) Description() string
- func (g *Graph) Device() *Device
- func (g *Graph) GatherWithDimensionSourceIndices(dimension int, source *Tensor, indices *Tensor) *Tensor
- func (g *Graph) IsEqual(other obj.Object) bool
- func (g *Graph) IsKind(className string) bool
- func (g *Graph) Layers() []*Layer
- func (g *Graph) NodeWithLayerSource(layer *Layer, source *Tensor) *Tensor
- func (g *Graph) NodeWithLayerSources(layer *Layer, sources []*Tensor) *Tensor
- func (g *Graph) NodeWithLayerSourcesDisableUpdate(layer *Layer, sources []*Tensor, disableUpdate bool) *Tensor
- func (g *Graph) NodeWithLayerSourcesLossLabels(layer *Layer, sources []*Tensor, lossLabels []*Tensor) *Tensor
- func (g *Graph) ReshapeWithShapeSource(shape []*foundation.Number, source *Tensor) *Tensor
- func (g *Graph) ResultTensorsForLayer(layer *Layer) []*Tensor
- func (g *Graph) ScatterWithDimensionSourceIndicesCopyFromReductionType(dimension int, source *Tensor, indices *Tensor, copyFrom *Tensor, ...) *Tensor
- func (g *Graph) SelectWithSourcesCondition(sources []*Tensor, condition *Tensor) *Tensor
- func (g *Graph) SourceTensorsForLayer(layer *Layer) []*Tensor
- func (g *Graph) SplitWithSourceSplitCountDimension(source *Tensor, splitCount int, dimension int) []*Tensor
- func (g *Graph) SplitWithSourceSplitSectionLengthsDimension(source *Tensor, splitSectionLengths []*foundation.Number, dimension int) []*Tensor
- func (g *Graph) String() string
- func (g *Graph) SummarizedDOTDescription() string
- func (g *Graph) TransposeWithDimensionsSource(dimensions []*foundation.Number, source *Tensor) *Tensor
- type GraphCompilationOptions
- type GraphProvider
- type GroupNormalizationLayer
- func (gnl *GroupNormalizationLayer) Beta() *Tensor
- func (gnl *GroupNormalizationLayer) BetaParameter() *TensorParameter
- func (gnl *GroupNormalizationLayer) FeatureChannelCount() int
- func (gnl *GroupNormalizationLayer) Gamma() *Tensor
- func (gnl *GroupNormalizationLayer) GammaParameter() *TensorParameter
- func (gnl *GroupNormalizationLayer) GroupCount() int
- func (gnl *GroupNormalizationLayer) VarianceEpsilon() float32
- func (gnl *GroupNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *GroupNormalizationLayer
- func (gnl *GroupNormalizationLayer) WithLabel(label string) *GroupNormalizationLayer
- type Idtype
- type InferenceGraph
- func (ig *InferenceGraph) AddInputs(inputs map[string]*Tensor) bool
- func (ig *InferenceGraph) AddInputsLossLabelsLossLabelWeights(inputs map[string]*Tensor, lossLabels map[string]*Tensor, ...) bool
- func (ig *InferenceGraph) AddOutputs(outputs map[string]*Tensor) bool
- func (ig *InferenceGraph) CompileWithOptionsDevice(options GraphCompilationOptions, device *Device) bool
- func (ig *InferenceGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options GraphCompilationOptions, device *Device, ...) bool
- func (ig *InferenceGraph) DeviceMemorySize() int
- func (ig *InferenceGraph) ExecuteWithInputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, batchSize int, options ExecutionOptions, ...) bool
- func (ig *InferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, ...) bool
- func (ig *InferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, ...) bool
- func (ig *InferenceGraph) ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, outputsData map[string]*TensorData, ...) bool
- func (ig *InferenceGraph) LinkWithGraphs(graphs []*InferenceGraph) bool
- type InstanceNormalizationLayer
- func InstanceNormalizationLayerFromID(id objc.ID) *InstanceNormalizationLayer
- func LayerWithFeatureChannelCountBetaGammaVarianceEpsilon(featureChannelCount int, beta *Tensor, gamma *Tensor, varianceEpsilon float32) *InstanceNormalizationLayer
- func LayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum(featureChannelCount int, beta *Tensor, gamma *Tensor, varianceEpsilon float32, ...) *InstanceNormalizationLayer
- func MLCInstanceNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount int, mean *Tensor, variance *Tensor, beta *Tensor, ...) *InstanceNormalizationLayer
- func NewInstanceNormalizationLayer() *InstanceNormalizationLayer
- func (inl *InstanceNormalizationLayer) Beta() *Tensor
- func (inl *InstanceNormalizationLayer) BetaParameter() *TensorParameter
- func (inl *InstanceNormalizationLayer) FeatureChannelCount() int
- func (inl *InstanceNormalizationLayer) Gamma() *Tensor
- func (inl *InstanceNormalizationLayer) GammaParameter() *TensorParameter
- func (inl *InstanceNormalizationLayer) Mean() *Tensor
- func (inl *InstanceNormalizationLayer) Momentum() float32
- func (inl *InstanceNormalizationLayer) Variance() *Tensor
- func (inl *InstanceNormalizationLayer) VarianceEpsilon() float32
- func (inl *InstanceNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *InstanceNormalizationLayer
- func (inl *InstanceNormalizationLayer) WithLabel(label string) *InstanceNormalizationLayer
- type IpcInfoObjectType
- type LSTMDescriptor
- func DescriptorWithInputSizeHiddenSizeLayerCount(inputSize int, hiddenSize int, layerCount int) *LSTMDescriptor
- func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout(inputSize int, hiddenSize int, layerCount int, usesBiases bool, ...) *LSTMDescriptor
- func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout(inputSize int, hiddenSize int, layerCount int, usesBiases bool, ...) *LSTMDescriptor
- func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode(inputSize int, hiddenSize int, layerCount int, usesBiases bool, ...) *LSTMDescriptor
- func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout(inputSize int, hiddenSize int, layerCount int, usesBiases bool, ...) *LSTMDescriptor
- func LSTMDescriptorFromID(id objc.ID) *LSTMDescriptor
- func NewLSTMDescriptor() *LSTMDescriptor
- func (ld *LSTMDescriptor) BatchFirst() bool
- func (ld *LSTMDescriptor) Description() string
- func (ld *LSTMDescriptor) Dropout() float32
- func (ld *LSTMDescriptor) HiddenSize() int
- func (ld *LSTMDescriptor) InputSize() int
- func (ld *LSTMDescriptor) IsBidirectional() bool
- func (ld *LSTMDescriptor) IsEqual(other obj.Object) bool
- func (ld *LSTMDescriptor) IsKind(className string) bool
- func (ld *LSTMDescriptor) LayerCount() int
- func (ld *LSTMDescriptor) ResultMode() LSTMResultMode
- func (ld *LSTMDescriptor) ReturnsSequences() bool
- func (ld *LSTMDescriptor) String() string
- func (ld *LSTMDescriptor) UsesBiases() bool
- type LSTMLayer
- func LSTMLayerFromID(id objc.ID) *LSTMLayer
- func LayerWithDescriptorInputWeightsHiddenWeightsBiases(descriptor *LSTMDescriptor, inputWeights []*Tensor, hiddenWeights []*Tensor, ...) *LSTMLayer
- func LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases(descriptor *LSTMDescriptor, inputWeights []*Tensor, hiddenWeights []*Tensor, ...) *LSTMLayer
- func LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation(descriptor *LSTMDescriptor, inputWeights []*Tensor, hiddenWeights []*Tensor, ...) *LSTMLayer
- func NewLSTMLayer() *LSTMLayer
- func (ll *LSTMLayer) Biases() []*Tensor
- func (ll *LSTMLayer) BiasesParameters() []*TensorParameter
- func (ll *LSTMLayer) Descriptor() *LSTMDescriptor
- func (ll *LSTMLayer) GateActivations() []*ActivationDescriptor
- func (ll *LSTMLayer) HiddenWeights() []*Tensor
- func (ll *LSTMLayer) HiddenWeightsParameters() []*TensorParameter
- func (ll *LSTMLayer) InputWeights() []*Tensor
- func (ll *LSTMLayer) InputWeightsParameters() []*TensorParameter
- func (ll *LSTMLayer) OutputResultActivation() *ActivationDescriptor
- func (ll *LSTMLayer) PeepholeWeights() []*Tensor
- func (ll *LSTMLayer) PeepholeWeightsParameters() []*TensorParameter
- func (ll *LSTMLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *LSTMLayer
- func (ll *LSTMLayer) WithLabel(label string) *LSTMLayer
- type LSTMResultMode
- type LaunchDataType
- type Layer
- func (l *Layer) Description() string
- func (l *Layer) DeviceType() DeviceType
- func (l *Layer) IsDebuggingEnabled() bool
- func (l *Layer) IsEqual(other obj.Object) bool
- func (l *Layer) IsKind(className string) bool
- func (l *Layer) Label() string
- func (l *Layer) LayerID() int
- func (l *Layer) String() string
- func (l *Layer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *Layer
- func (l *Layer) WithLabel(label string) *Layer
- type LayerNormalizationLayer
- func (lnl *LayerNormalizationLayer) Beta() *Tensor
- func (lnl *LayerNormalizationLayer) BetaParameter() *TensorParameter
- func (lnl *LayerNormalizationLayer) Gamma() *Tensor
- func (lnl *LayerNormalizationLayer) GammaParameter() *TensorParameter
- func (lnl *LayerNormalizationLayer) NormalizedShape() []obj.Object
- func (lnl *LayerNormalizationLayer) VarianceEpsilon() float32
- func (lnl *LayerNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *LayerNormalizationLayer
- func (lnl *LayerNormalizationLayer) WithLabel(label string) *LayerNormalizationLayer
- type LayerProvider
- type LossDescriptor
- func DescriptorWithTypeReductionType(lossType LossType, reductionType ReductionType) *LossDescriptor
- func DescriptorWithTypeReductionTypeWeight(lossType LossType, reductionType ReductionType, weight float32) *LossDescriptor
- func DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount(lossType LossType, reductionType ReductionType, weight float32, ...) *LossDescriptor
- func DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta(lossType LossType, reductionType ReductionType, weight float32, ...) *LossDescriptor
- func LossDescriptorFromID(id objc.ID) *LossDescriptor
- func NewLossDescriptor() *LossDescriptor
- func (ld *LossDescriptor) ClassCount() int
- func (ld *LossDescriptor) Delta() float32
- func (ld *LossDescriptor) Description() string
- func (ld *LossDescriptor) Epsilon() float32
- func (ld *LossDescriptor) IsEqual(other obj.Object) bool
- func (ld *LossDescriptor) IsKind(className string) bool
- func (ld *LossDescriptor) LabelSmoothing() float32
- func (ld *LossDescriptor) LossType() LossType
- func (ld *LossDescriptor) ReductionType() ReductionType
- func (ld *LossDescriptor) String() string
- func (ld *LossDescriptor) Weight() float32
- type LossLayer
- func CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType ReductionType, labelSmoothing float32, classCount int, ...) *LossLayer
- func CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType ReductionType, labelSmoothing float32, classCount int, ...) *LossLayer
- func CosineDistanceLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
- func CosineDistanceLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
- func HingeLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
- func HingeLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
- func HuberLossWithReductionTypeDeltaWeight(reductionType ReductionType, delta float32, weight float32) *LossLayer
- func HuberLossWithReductionTypeDeltaWeights(reductionType ReductionType, delta float32, weights *Tensor) *LossLayer
- func LogLossWithReductionTypeEpsilonWeight(reductionType ReductionType, epsilon float32, weight float32) *LossLayer
- func LogLossWithReductionTypeEpsilonWeights(reductionType ReductionType, epsilon float32, weights *Tensor) *LossLayer
- func LossLayerFromID(id objc.ID) *LossLayer
- func MLCLossLayerLayerWithDescriptor(lossDescriptor *LossDescriptor) *LossLayer
- func MLCLossLayerLayerWithDescriptorWeights(lossDescriptor *LossDescriptor, weights *Tensor) *LossLayer
- func MeanAbsoluteErrorLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
- func MeanAbsoluteErrorLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
- func MeanSquaredErrorLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
- func MeanSquaredErrorLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
- func SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight(reductionType ReductionType, labelSmoothing float32, weight float32) *LossLayer
- func SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights(reductionType ReductionType, labelSmoothing float32, weights *Tensor) *LossLayer
- func SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType ReductionType, labelSmoothing float32, classCount int, ...) *LossLayer
- func SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType ReductionType, labelSmoothing float32, classCount int, ...) *LossLayer
- type LossLayerProvider
- type LossType
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type MachVMRangeFlags
- type MachVMRangeFlavor
- type MachVMRangeTag
- type MatMulDescriptor
- func (mmd *MatMulDescriptor) Alpha() float32
- func (mmd *MatMulDescriptor) Description() string
- func (mmd *MatMulDescriptor) IsEqual(other obj.Object) bool
- func (mmd *MatMulDescriptor) IsKind(className string) bool
- func (mmd *MatMulDescriptor) String() string
- func (mmd *MatMulDescriptor) TransposesX() bool
- func (mmd *MatMulDescriptor) TransposesY() bool
- type MatMulLayer
- type MpoFlags
- type MultiheadAttentionDescriptor
- func DescriptorWithModelDimensionHeadCount(modelDimension int, headCount int) *MultiheadAttentionDescriptor
- func DescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention(modelDimension int, keyDimension int, valueDimension int, headCount int, ...) *MultiheadAttentionDescriptor
- func MultiheadAttentionDescriptorFromID(id objc.ID) *MultiheadAttentionDescriptor
- func NewMultiheadAttentionDescriptor() *MultiheadAttentionDescriptor
- func (mad *MultiheadAttentionDescriptor) AddsZeroAttention() bool
- func (mad *MultiheadAttentionDescriptor) Description() string
- func (mad *MultiheadAttentionDescriptor) Dropout() float32
- func (mad *MultiheadAttentionDescriptor) HasAttentionBiases() bool
- func (mad *MultiheadAttentionDescriptor) HasBiases() bool
- func (mad *MultiheadAttentionDescriptor) HeadCount() int
- func (mad *MultiheadAttentionDescriptor) IsEqual(other obj.Object) bool
- func (mad *MultiheadAttentionDescriptor) IsKind(className string) bool
- func (mad *MultiheadAttentionDescriptor) KeyDimension() int
- func (mad *MultiheadAttentionDescriptor) ModelDimension() int
- func (mad *MultiheadAttentionDescriptor) String() string
- func (mad *MultiheadAttentionDescriptor) ValueDimension() int
- type MultiheadAttentionLayer
- func (mal *MultiheadAttentionLayer) AttentionBiases() []*Tensor
- func (mal *MultiheadAttentionLayer) Biases() []*Tensor
- func (mal *MultiheadAttentionLayer) BiasesParameters() []*TensorParameter
- func (mal *MultiheadAttentionLayer) Descriptor() *MultiheadAttentionDescriptor
- func (mal *MultiheadAttentionLayer) Weights() []*Tensor
- func (mal *MultiheadAttentionLayer) WeightsParameters() []*TensorParameter
- func (mal *MultiheadAttentionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *MultiheadAttentionLayer
- func (mal *MultiheadAttentionLayer) WithLabel(label string) *MultiheadAttentionLayer
- type OSClockid
- type Optimizer
- func (o *Optimizer) AppliesGradientClipping() bool
- func (o *Optimizer) CustomGlobalNorm() float32
- func (o *Optimizer) Description() string
- func (o *Optimizer) GradientClipMax() float32
- func (o *Optimizer) GradientClipMin() float32
- func (o *Optimizer) GradientClippingType() GradientClippingType
- func (o *Optimizer) GradientRescale() float32
- func (o *Optimizer) IsEqual(other obj.Object) bool
- func (o *Optimizer) IsKind(className string) bool
- func (o *Optimizer) LearningRate() float32
- func (o *Optimizer) MaximumClippingNorm() float32
- func (o *Optimizer) RegularizationScale() float32
- func (o *Optimizer) RegularizationType() RegularizationType
- func (o *Optimizer) String() string
- func (o *Optimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *Optimizer
- func (o *Optimizer) WithLearningRate(learningRate float32) *Optimizer
- type OptimizerDescriptor
- func DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, ...) *OptimizerDescriptor
- func DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, ...) *OptimizerDescriptor
- func DescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, ...) *OptimizerDescriptor
- func NewOptimizerDescriptor() *OptimizerDescriptor
- func OptimizerDescriptorFromID(id objc.ID) *OptimizerDescriptor
- func (od *OptimizerDescriptor) AppliesGradientClipping() bool
- func (od *OptimizerDescriptor) CustomGlobalNorm() float32
- func (od *OptimizerDescriptor) Description() string
- func (od *OptimizerDescriptor) GradientClipMax() float32
- func (od *OptimizerDescriptor) GradientClipMin() float32
- func (od *OptimizerDescriptor) GradientClippingType() GradientClippingType
- func (od *OptimizerDescriptor) GradientRescale() float32
- func (od *OptimizerDescriptor) IsEqual(other obj.Object) bool
- func (od *OptimizerDescriptor) IsKind(className string) bool
- func (od *OptimizerDescriptor) LearningRate() float32
- func (od *OptimizerDescriptor) MaximumClippingNorm() float32
- func (od *OptimizerDescriptor) RegularizationScale() float32
- func (od *OptimizerDescriptor) RegularizationType() RegularizationType
- func (od *OptimizerDescriptor) String() string
- type OptimizerProvider
- type PaddingLayer
- func LayerWithConstantPaddingConstantValue(padding []*foundation.Number, constantValue float32) *PaddingLayer
- func LayerWithReflectionPadding(padding []*foundation.Number) *PaddingLayer
- func LayerWithSymmetricPadding(padding []*foundation.Number) *PaddingLayer
- func LayerWithZeroPadding(padding []*foundation.Number) *PaddingLayer
- func NewPaddingLayer() *PaddingLayer
- func PaddingLayerFromID(id objc.ID) *PaddingLayer
- func (pl *PaddingLayer) ConstantValue() float32
- func (pl *PaddingLayer) PaddingBottom() int
- func (pl *PaddingLayer) PaddingLeft() int
- func (pl *PaddingLayer) PaddingRight() int
- func (pl *PaddingLayer) PaddingTop() int
- func (pl *PaddingLayer) PaddingType() PaddingType
- func (pl *PaddingLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *PaddingLayer
- func (pl *PaddingLayer) WithLabel(label string) *PaddingLayer
- type PaddingPolicy
- type PaddingType
- type Perm
- type Platform
- type PoolingDescriptor
- func AveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes []*foundation.Number, strides []*foundation.Number, ...) *PoolingDescriptor
- func AveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes []*foundation.Number, strides []*foundation.Number, ...) *PoolingDescriptor
- func L2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, ...) *PoolingDescriptor
- func L2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, ...) *PoolingDescriptor
- func MaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, ...) *PoolingDescriptor
- func MaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, ...) *PoolingDescriptor
- func NewPoolingDescriptor() *PoolingDescriptor
- func PoolingDescriptorFromID(id objc.ID) *PoolingDescriptor
- func PoolingDescriptorWithTypeKernelSizeStride(poolingType PoolingType, kernelSize int, stride int) *PoolingDescriptor
- func (pd *PoolingDescriptor) CountIncludesPadding() bool
- func (pd *PoolingDescriptor) Description() string
- func (pd *PoolingDescriptor) DilationRateInX() int
- func (pd *PoolingDescriptor) DilationRateInY() int
- func (pd *PoolingDescriptor) IsEqual(other obj.Object) bool
- func (pd *PoolingDescriptor) IsKind(className string) bool
- func (pd *PoolingDescriptor) KernelHeight() int
- func (pd *PoolingDescriptor) KernelWidth() int
- func (pd *PoolingDescriptor) PaddingPolicy() PaddingPolicy
- func (pd *PoolingDescriptor) PaddingSizeInX() int
- func (pd *PoolingDescriptor) PaddingSizeInY() int
- func (pd *PoolingDescriptor) PoolingType() PoolingType
- func (pd *PoolingDescriptor) StrideInX() int
- func (pd *PoolingDescriptor) StrideInY() int
- func (pd *PoolingDescriptor) String() string
- type PoolingLayer
- type PoolingType
- type PtrauthKey
- type QosClass
- type RMSPropOptimizer
- func MLCRMSPropOptimizerOptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *RMSPropOptimizer
- func NewRMSPropOptimizer() *RMSPropOptimizer
- func OptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered(optimizerDescriptor *OptimizerDescriptor, momentumScale float32, alpha float32, ...) *RMSPropOptimizer
- func RMSPropOptimizerFromID(id objc.ID) *RMSPropOptimizer
- func (rpo *RMSPropOptimizer) Alpha() float32
- func (rpo *RMSPropOptimizer) Epsilon() float32
- func (rpo *RMSPropOptimizer) IsCentered() bool
- func (rpo *RMSPropOptimizer) MomentumScale() float32
- func (rpo *RMSPropOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *RMSPropOptimizer
- func (rpo *RMSPropOptimizer) WithLearningRate(learningRate float32) *RMSPropOptimizer
- type RandomInitializerType
- type ReductionLayer
- func LayerWithReductionTypeDimension(reductionType ReductionType, dimension int) *ReductionLayer
- func LayerWithReductionTypeDimensions(reductionType ReductionType, dimensions []*foundation.Number) *ReductionLayer
- func NewReductionLayer() *ReductionLayer
- func ReductionLayerFromID(id objc.ID) *ReductionLayer
- func (rl *ReductionLayer) Dimension() int
- func (rl *ReductionLayer) Dimensions() []obj.Object
- func (rl *ReductionLayer) ReductionType() ReductionType
- func (rl *ReductionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ReductionLayer
- func (rl *ReductionLayer) WithLabel(label string) *ReductionLayer
- type ReductionType
- type RegularizationType
- type ReshapeLayer
- type SGDOptimizer
- func MLCSGDOptimizerOptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *SGDOptimizer
- func NewSGDOptimizer() *SGDOptimizer
- func OptimizerWithDescriptorMomentumScaleUsesNesterovMomentum(optimizerDescriptor *OptimizerDescriptor, momentumScale float32, ...) *SGDOptimizer
- func SGDOptimizerFromID(id objc.ID) *SGDOptimizer
- type SampleMode
- type ScatterLayer
- type SelectionLayer
- type SliceLayer
- type SoftmaxLayer
- type SoftmaxOperation
- type SplitLayer
- type Tag
- type Tensor
- func NewTensor() *Tensor
- func TensorFromID(id objc.ID) *Tensor
- func TensorWithDescriptor(tensorDescriptor *TensorDescriptor) *Tensor
- func TensorWithDescriptorData(tensorDescriptor *TensorDescriptor, data *TensorData) *Tensor
- func TensorWithDescriptorFillWithData(tensorDescriptor *TensorDescriptor, fillData obj.Object) *Tensor
- func TensorWithDescriptorRandomInitializerType(tensorDescriptor *TensorDescriptor, ...) *Tensor
- func TensorWithSequenceLengthFeatureChannelCountBatchSize(sequenceLength int, featureChannelCount int, batchSize int) *Tensor
- func TensorWithSequenceLengthFeatureChannelCountBatchSizeData(sequenceLength int, featureChannelCount int, batchSize int, data *TensorData) *Tensor
- func TensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType(sequenceLength int, featureChannelCount int, batchSize int, ...) *Tensor
- func TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData(sequenceLengths []*foundation.Number, sortedSequences bool, ...) *Tensor
- func TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType(sequenceLengths []*foundation.Number, sortedSequences bool, ...) *Tensor
- func TensorWithShape(shape []*foundation.Number) *Tensor
- func TensorWithShapeDataDataType(shape []*foundation.Number, data *TensorData, dataType DataType) *Tensor
- func TensorWithShapeDataType(shape []*foundation.Number, dataType DataType) *Tensor
- func TensorWithShapeFillWithDataDataType(shape []*foundation.Number, fillData obj.Object, dataType DataType) *Tensor
- func TensorWithShapeRandomInitializerType(shape []*foundation.Number, randomInitializerType RandomInitializerType) *Tensor
- func TensorWithShapeRandomInitializerTypeDataType(shape []*foundation.Number, randomInitializerType RandomInitializerType, ...) *Tensor
- func TensorWithWidthHeightFeatureChannelCountBatchSize(width int, height int, featureChannelCount int, batchSize int) *Tensor
- func TensorWithWidthHeightFeatureChannelCountBatchSizeData(width int, height int, featureChannelCount int, batchSize int, ...) *Tensor
- func TensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType(width int, height int, featureChannelCount int, batchSize int, ...) *Tensor
- func TensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType(width int, height int, featureChannelCount int, batchSize int, ...) *Tensor
- func TensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType(width int, height int, featureChannelCount int, batchSize int, ...) *Tensor
- func (t *Tensor) BindAndWriteDataToDevice(data *TensorData, device *Device) bool
- func (t *Tensor) BindOptimizerDataDeviceData(data []*TensorData, deviceData []*TensorOptimizerDeviceData) bool
- func (t *Tensor) CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice(data unsafe.Pointer, length int, synchronizeWithDevice bool) bool
- func (t *Tensor) Data() []byte
- func (t *Tensor) Description() string
- func (t *Tensor) Descriptor() *TensorDescriptor
- func (t *Tensor) Device() *Device
- func (t *Tensor) HasValidNumerics() bool
- func (t *Tensor) IsEqual(other obj.Object) bool
- func (t *Tensor) IsKind(className string) bool
- func (t *Tensor) Label() string
- func (t *Tensor) OptimizerData() []*TensorData
- func (t *Tensor) OptimizerDeviceData() []*TensorOptimizerDeviceData
- func (t *Tensor) String() string
- func (t *Tensor) SynchronizeData() bool
- func (t *Tensor) SynchronizeOptimizerData() bool
- func (t *Tensor) TensorByDequantizingToTypeScaleBias(type_ DataType, scale *Tensor, bias *Tensor) *Tensor
- func (t *Tensor) TensorByDequantizingToTypeScaleBiasAxis(type_ DataType, scale *Tensor, bias *Tensor, axis int) *Tensor
- func (t *Tensor) TensorByQuantizingToTypeScaleBias(type_ DataType, scale float32, bias int) *Tensor
- func (t *Tensor) TensorByQuantizingToTypeScaleBiasAxis(type_ DataType, scale *Tensor, bias *Tensor, axis int) *Tensor
- func (t *Tensor) TensorID() int
- func (t *Tensor) WithLabel(label string) *Tensor
- type TensorData
- func DataWithBytesNoCopyLength(data unsafe.Pointer, length int) *TensorData
- func DataWithBytesNoCopyLengthDeallocator(data unsafe.Pointer, length int, deallocator func(unsafe.Pointer, int)) *TensorData
- func DataWithImmutableBytesNoCopyLength(data unsafe.Pointer, length int) *TensorData
- func NewTensorData() *TensorData
- func TensorDataFromID(id objc.ID) *TensorData
- type TensorDescriptor
- func ConvolutionBiasesDescriptorWithFeatureChannelCountDataType(featureChannelCount int, dataType DataType) *TensorDescriptor
- func ConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType(inputFeatureChannelCount int, outputFeatureChannelCount int, dataType DataType) *TensorDescriptor
- func ConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType(width int, height int, inputFeatureChannelCount int, ...) *TensorDescriptor
- func DescriptorWithShapeDataType(shape []*foundation.Number, dataType DataType) *TensorDescriptor
- func DescriptorWithShapeSequenceLengthsSortedSequencesDataType(shape []*foundation.Number, sequenceLengths []*foundation.Number, ...) *TensorDescriptor
- func DescriptorWithWidthHeightFeatureChannelCountBatchSize(width int, height int, featureChannels int, batchSize int) *TensorDescriptor
- func DescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType(width int, height int, featureChannelCount int, batchSize int, ...) *TensorDescriptor
- func NewTensorDescriptor() *TensorDescriptor
- func TensorDescriptorFromID(id objc.ID) *TensorDescriptor
- func (td *TensorDescriptor) BatchSizePerSequenceStep() []obj.Object
- func (td *TensorDescriptor) DataType() DataType
- func (td *TensorDescriptor) Description() string
- func (td *TensorDescriptor) DimensionCount() int
- func (td *TensorDescriptor) IsEqual(other obj.Object) bool
- func (td *TensorDescriptor) IsKind(className string) bool
- func (td *TensorDescriptor) SequenceLengths() []obj.Object
- func (td *TensorDescriptor) Shape() []obj.Object
- func (td *TensorDescriptor) SortedSequences() bool
- func (td *TensorDescriptor) Stride() []obj.Object
- func (td *TensorDescriptor) String() string
- func (td *TensorDescriptor) TensorAllocationSizeInBytes() int
- type TensorOptimizerDeviceData
- type TensorParameter
- func (tp *TensorParameter) Description() string
- func (tp *TensorParameter) IsEqual(other obj.Object) bool
- func (tp *TensorParameter) IsKind(className string) bool
- func (tp *TensorParameter) IsUpdatable() bool
- func (tp *TensorParameter) String() string
- func (tp *TensorParameter) Tensor() *Tensor
- func (tp *TensorParameter) WithIsUpdatable(isUpdatable bool) *TensorParameter
- type TrainingGraph
- func (tg *TrainingGraph) AddInputsLossLabels(inputs map[string]*Tensor, lossLabels map[string]*Tensor) bool
- func (tg *TrainingGraph) AddInputsLossLabelsLossLabelWeights(inputs map[string]*Tensor, lossLabels map[string]*Tensor, ...) bool
- func (tg *TrainingGraph) AddOutputs(outputs map[string]*Tensor) bool
- func (tg *TrainingGraph) AllocateUserGradientForTensor(tensor *Tensor) *Tensor
- func (tg *TrainingGraph) BindOptimizerDataDeviceDataWithTensor(data []*TensorData, deviceData []*TensorOptimizerDeviceData, tensor *Tensor) bool
- func (tg *TrainingGraph) CompileOptimizer(optimizer *Optimizer) bool
- func (tg *TrainingGraph) CompileWithOptionsDevice(options GraphCompilationOptions, device *Device) bool
- func (tg *TrainingGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options GraphCompilationOptions, device *Device, ...) bool
- func (tg *TrainingGraph) DeviceMemorySize() int
- func (tg *TrainingGraph) ExecuteForwardWithBatchSizeOptionsCompletionHandler(batchSize int, options ExecutionOptions, ...) bool
- func (tg *TrainingGraph) ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize int, options ExecutionOptions, outputsData map[string]*TensorData, ...) bool
- func (tg *TrainingGraph) ExecuteGradientWithBatchSizeOptionsCompletionHandler(batchSize int, options ExecutionOptions, ...) bool
- func (tg *TrainingGraph) ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize int, options ExecutionOptions, outputsData map[string]*TensorData, ...) bool
- func (tg *TrainingGraph) ExecuteOptimizerUpdateWithOptionsCompletionHandler(options ExecutionOptions, ...) bool
- func (tg *TrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, ...) bool
- func (tg *TrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, ...) bool
- func (tg *TrainingGraph) GradientDataForParameterLayer(parameter *Tensor, layer *Layer) []byte
- func (tg *TrainingGraph) GradientTensorForInput(input *Tensor) *Tensor
- func (tg *TrainingGraph) LinkWithGraphs(graphs []*TrainingGraph) bool
- func (tg *TrainingGraph) Optimizer() *Optimizer
- func (tg *TrainingGraph) ResultGradientTensorsForLayer(layer *Layer) []*Tensor
- func (tg *TrainingGraph) SetTrainingTensorParameters(parameters []*TensorParameter) bool
- func (tg *TrainingGraph) SourceGradientTensorsForLayer(layer *Layer) []*Tensor
- func (tg *TrainingGraph) StopGradientForTensors(tensors []*Tensor) bool
- func (tg *TrainingGraph) SynchronizeUpdates()
- type TransposeLayer
- type Type
- type UpsampleLayer
- type VirtualMemoryGuardExceptionCode
- type XpcListenerCreateFlags
- type XpcSessionCreateFlags
- type YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) AnchorBoxCount() int
- func (yld *YOLOLossDescriptor) AnchorBoxes() []byte
- func (yld *YOLOLossDescriptor) Description() string
- func (yld *YOLOLossDescriptor) IsEqual(other obj.Object) bool
- func (yld *YOLOLossDescriptor) IsKind(className string) bool
- func (yld *YOLOLossDescriptor) MaximumIOUForObjectAbsence() float32
- func (yld *YOLOLossDescriptor) MinimumIOUForObjectPresence() float32
- func (yld *YOLOLossDescriptor) ScaleClassLoss() float32
- func (yld *YOLOLossDescriptor) ScaleNoObjectConfidenceLoss() float32
- func (yld *YOLOLossDescriptor) ScaleObjectConfidenceLoss() float32
- func (yld *YOLOLossDescriptor) ScaleSpatialPositionLoss() float32
- func (yld *YOLOLossDescriptor) ScaleSpatialSizeLoss() float32
- func (yld *YOLOLossDescriptor) ShouldRescore() bool
- func (yld *YOLOLossDescriptor) String() string
- func (yld *YOLOLossDescriptor) WithMaximumIOUForObjectAbsence(maximumIOUForObjectAbsence float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithMinimumIOUForObjectPresence(minimumIOUForObjectPresence float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithScaleClassLoss(scaleClassLoss float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithScaleNoObjectConfidenceLoss(scaleNoObjectConfidenceLoss float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithScaleObjectConfidenceLoss(scaleObjectConfidenceLoss float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithScaleSpatialPositionLoss(scaleSpatialPositionLoss float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithScaleSpatialSizeLoss(scaleSpatialSizeLoss float32) *YOLOLossDescriptor
- func (yld *YOLOLossDescriptor) WithShouldRescore(shouldRescore bool) *YOLOLossDescriptor
- type YOLOLossLayer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRNGseed ¶ added in v0.17.0
func GetRNGseed() *foundation.Number
GetRNGseed returns the global random number generator seed value.
func MLCActivationTypeDebugDescription ¶
func MLCActivationTypeDebugDescription(activationType ActivationType) string
MLCActivationTypeDebugDescription calls the MLCompute framework function MLCActivationTypeDebugDescription.
func MLCArithmeticOperationDebugDescription ¶
func MLCArithmeticOperationDebugDescription(operation ArithmeticOperation) string
MLCArithmeticOperationDebugDescription calls the MLCompute framework function MLCArithmeticOperationDebugDescription.
func MLCComparisonOperationDebugDescription ¶
func MLCComparisonOperationDebugDescription(operation ComparisonOperation) string
MLCComparisonOperationDebugDescription calls the MLCompute framework function MLCComparisonOperationDebugDescription.
func MLCConvolutionTypeDebugDescription ¶
func MLCConvolutionTypeDebugDescription(convolutionType ConvolutionType) string
MLCConvolutionTypeDebugDescription calls the MLCompute framework function MLCConvolutionTypeDebugDescription.
func MLCGradientClippingTypeDebugDescription ¶
func MLCGradientClippingTypeDebugDescription(gradientClippingType GradientClippingType) string
MLCGradientClippingTypeDebugDescription calls the MLCompute framework function MLCGradientClippingTypeDebugDescription.
func MLCLSTMResultModeDebugDescription ¶
func MLCLSTMResultModeDebugDescription(mode LSTMResultMode) string
MLCLSTMResultModeDebugDescription calls the MLCompute framework function MLCLSTMResultModeDebugDescription.
func MLCLossTypeDebugDescription ¶
MLCLossTypeDebugDescription calls the MLCompute framework function MLCLossTypeDebugDescription.
func MLCPaddingPolicyDebugDescription ¶
func MLCPaddingPolicyDebugDescription(paddingPolicy PaddingPolicy) string
MLCPaddingPolicyDebugDescription calls the MLCompute framework function MLCPaddingPolicyDebugDescription.
func MLCPaddingTypeDebugDescription ¶
func MLCPaddingTypeDebugDescription(paddingType PaddingType) string
MLCPaddingTypeDebugDescription calls the MLCompute framework function MLCPaddingTypeDebugDescription.
func MLCPoolingTypeDebugDescription ¶
func MLCPoolingTypeDebugDescription(poolingType PoolingType) string
MLCPoolingTypeDebugDescription calls the MLCompute framework function MLCPoolingTypeDebugDescription.
func MLCReductionTypeDebugDescription ¶
func MLCReductionTypeDebugDescription(reductionType ReductionType) string
MLCReductionTypeDebugDescription calls the MLCompute framework function MLCReductionTypeDebugDescription.
func MLCSampleModeDebugDescription ¶
func MLCSampleModeDebugDescription(mode SampleMode) string
MLCSampleModeDebugDescription calls the MLCompute framework function MLCSampleModeDebugDescription.
func MLCSoftmaxOperationDebugDescription ¶
func MLCSoftmaxOperationDebugDescription(operation SoftmaxOperation) string
MLCSoftmaxOperationDebugDescription calls the MLCompute framework function MLCSoftmaxOperationDebugDescription.
func MaxTensorDimensions ¶ added in v0.17.0
func MaxTensorDimensions() int
MaxTensorDimensions returns the maximum number of tensor dimensions supported
func SetRNGSeedTo ¶ added in v0.17.0
SetRNGSeedTo sets the global random number generator seed value.
func SupportsDataTypeOnDevice ¶ added in v0.17.0
SupportsDataTypeOnDevice returns a Boolean that indicates whether instances of this layer accept source tensors for the data type and device that you specify.
Types ¶
type ActivationDescriptor ¶ added in v0.17.0
ActivationDescriptor is an idiomatic wrapper over the Objective-C class MLCActivationDescriptor.
A configuration object you use to create an activation layer.
func ActivationDescriptorFromID ¶ added in v0.17.0
func ActivationDescriptorFromID(id objc.ID) *ActivationDescriptor
ActivationDescriptorFromID adopts an existing Objective-C object as a ActivationDescriptor (nil for 0), retaining it and registering a release finalizer.
func DescriptorWithType ¶ added in v0.17.0
func DescriptorWithType(activationType ActivationType) *ActivationDescriptor
DescriptorWithType creates an activation descriptor with the activation type you specify.
func DescriptorWithTypeA ¶ added in v0.17.0
func DescriptorWithTypeA(activationType ActivationType, a float32) *ActivationDescriptor
DescriptorWithTypeA creates an activation descriptor with the activation type and parameter a that you specify.
func DescriptorWithTypeAB ¶ added in v0.17.0
func DescriptorWithTypeAB(activationType ActivationType, a float32, b float32) *ActivationDescriptor
DescriptorWithTypeAB creates an activation descriptor with the activation type and parameters a and b that you specify.
func DescriptorWithTypeABC ¶ added in v0.17.0
func DescriptorWithTypeABC(activationType ActivationType, a float32, b float32, c float32) *ActivationDescriptor
DescriptorWithTypeABC creates an activation descriptor with the activation type and parameters a, b, and c that you specify.
func NewActivationDescriptor ¶ added in v0.17.0
func NewActivationDescriptor() *ActivationDescriptor
NewActivationDescriptor creates a new ActivationDescriptor.
func (*ActivationDescriptor) A ¶ added in v0.17.0
func (ad *ActivationDescriptor) A() float32
A returns parameter to the activation function
func (*ActivationDescriptor) ActivationType ¶ added in v0.17.0
func (ad *ActivationDescriptor) ActivationType() ActivationType
ActivationType returns the type of activation function
func (*ActivationDescriptor) B ¶ added in v0.17.0
func (ad *ActivationDescriptor) B() float32
B returns parameter to the activation function
func (*ActivationDescriptor) C ¶ added in v0.17.0
func (ad *ActivationDescriptor) C() float32
C returns parameter to the activation function
func (*ActivationDescriptor) Description ¶ added in v0.17.0
func (ad *ActivationDescriptor) Description() string
Description returns the object's -description text.
func (*ActivationDescriptor) IsEqual ¶ added in v0.17.0
func (ad *ActivationDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*ActivationDescriptor) IsKind ¶ added in v0.17.0
func (ad *ActivationDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*ActivationDescriptor) String ¶ added in v0.17.0
func (ad *ActivationDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type ActivationLayer ¶ added in v0.17.0
type ActivationLayer struct {
Layer
}
ActivationLayer is an idiomatic wrapper over the Objective-C class MLCActivationLayer.
It embeds Layer, promoting that type's methods.
A layer that applies an activation function to the source tensor and produces an output.
func AbsoluteLayer ¶ added in v0.17.0
func AbsoluteLayer() *ActivationLayer
AbsoluteLayer create an absolute activation layer
func ActivationLayerFromID ¶ added in v0.17.0
func ActivationLayerFromID(id objc.ID) *ActivationLayer
ActivationLayerFromID adopts an existing Objective-C object as a ActivationLayer (nil for 0), retaining it and registering a release finalizer.
func CeluLayer ¶ added in v0.17.0
func CeluLayer() *ActivationLayer
CeluLayer create a CELU activation layer
func CeluLayerWithA ¶ added in v0.17.0
func CeluLayerWithA(a float32) *ActivationLayer
CeluLayerWithA create a CELU activation layer
func ClampLayerWithMinValueMaxValue ¶ added in v0.17.0
func ClampLayerWithMinValueMaxValue(minValue float32, maxValue float32) *ActivationLayer
ClampLayerWithMinValueMaxValue create a clamp activation layer
func EluLayer ¶ added in v0.17.0
func EluLayer() *ActivationLayer
EluLayer create an ELU activation layer
func EluLayerWithA ¶ added in v0.17.0
func EluLayerWithA(a float32) *ActivationLayer
EluLayerWithA create an ELU activation layer
func GeluLayer ¶ added in v0.17.0
func GeluLayer() *ActivationLayer
GeluLayer create a GELU activation layer
func HardShrinkLayer ¶ added in v0.17.0
func HardShrinkLayer() *ActivationLayer
HardShrinkLayer create a hard shrink activation layer
func HardShrinkLayerWithA ¶ added in v0.17.0
func HardShrinkLayerWithA(a float32) *ActivationLayer
HardShrinkLayerWithA create a hard shrink activation layer
func HardSigmoidLayer ¶ added in v0.17.0
func HardSigmoidLayer() *ActivationLayer
HardSigmoidLayer create a hard sigmoid activation layer
func HardSwishLayer ¶ added in v0.17.0
func HardSwishLayer() *ActivationLayer
HardSwishLayer create a hardswish activation layer
func LayerWithDescriptor ¶ added in v0.17.0
func LayerWithDescriptor(descriptor *ActivationDescriptor) *ActivationLayer
LayerWithDescriptor creates an activation layer with the descriptor you specify.
func LeakyReLULayer ¶ added in v0.17.0
func LeakyReLULayer() *ActivationLayer
LeakyReLULayer create a leaky ReLU activation layer
func LeakyReLULayerWithNegativeSlope ¶ added in v0.17.0
func LeakyReLULayerWithNegativeSlope(negativeSlope float32) *ActivationLayer
LeakyReLULayerWithNegativeSlope create a leaky ReLU activation layer
func LinearLayerWithScaleBias ¶ added in v0.17.0
func LinearLayerWithScaleBias(scale float32, bias float32) *ActivationLayer
LinearLayerWithScaleBias create a linear activation layer
func LogSigmoidLayer ¶ added in v0.17.0
func LogSigmoidLayer() *ActivationLayer
LogSigmoidLayer create a log sigmoid activation layer
func NewActivationLayer ¶ added in v0.17.0
func NewActivationLayer() *ActivationLayer
NewActivationLayer creates a new ActivationLayer.
func Relu6Layer ¶ added in v0.17.0
func Relu6Layer() *ActivationLayer
Relu6Layer create a ReLU6 activation layer
func ReluLayer ¶ added in v0.17.0
func ReluLayer() *ActivationLayer
ReluLayer create a ReLU activation layer
func RelunLayerWithAB ¶ added in v0.17.0
func RelunLayerWithAB(a float32, b float32) *ActivationLayer
RelunLayerWithAB create a ReLUN activation layer This can be used to implement layers such as ReLU6 for example.
func SeluLayer ¶ added in v0.17.0
func SeluLayer() *ActivationLayer
SeluLayer create a SELU activation layer
func SigmoidLayer ¶ added in v0.17.0
func SigmoidLayer() *ActivationLayer
SigmoidLayer create a sigmoid activation layer
func SoftPlusLayer ¶ added in v0.17.0
func SoftPlusLayer() *ActivationLayer
SoftPlusLayer create a soft plus activation layer
func SoftPlusLayerWithBeta ¶ added in v0.17.0
func SoftPlusLayerWithBeta(beta float32) *ActivationLayer
SoftPlusLayerWithBeta create a soft plus activation layer
func SoftShrinkLayer ¶ added in v0.17.0
func SoftShrinkLayer() *ActivationLayer
SoftShrinkLayer create a soft shrink activation layer
func SoftShrinkLayerWithA ¶ added in v0.17.0
func SoftShrinkLayerWithA(a float32) *ActivationLayer
SoftShrinkLayerWithA create a soft shrink activation layer
func SoftSignLayer ¶ added in v0.17.0
func SoftSignLayer() *ActivationLayer
SoftSignLayer create a soft sign activation layer
func TanhLayer ¶ added in v0.17.0
func TanhLayer() *ActivationLayer
TanhLayer create a tanh activation layer
func TanhShrinkLayer ¶ added in v0.17.0
func TanhShrinkLayer() *ActivationLayer
TanhShrinkLayer create a TanhShrink activation layer
func ThresholdLayerWithThresholdReplacement ¶ added in v0.17.0
func ThresholdLayerWithThresholdReplacement(threshold float32, replacement float32) *ActivationLayer
ThresholdLayerWithThresholdReplacement create a threshold activation layer
func (*ActivationLayer) Descriptor ¶ added in v0.17.0
func (al *ActivationLayer) Descriptor() *ActivationDescriptor
Descriptor returns the activation descriptor
func (*ActivationLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (al *ActivationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ActivationLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ActivationLayer) WithLabel ¶ added in v0.17.0
func (al *ActivationLayer) WithLabel(label string) *ActivationLayer
WithLabel sets a string that helps identify this layer.
type ActivationType ¶ added in v0.17.0
type ActivationType int32
An activation type that you specify for an activation descriptor.
const ( // An activation type that implements the identity function. ActivationTypeNone ActivationType = 0 // An activation type that implements the rectified linear unit activation function. ActivationTypeReLU ActivationType = 1 // An activation type that implements the linear activation function. ActivationTypeLinear ActivationType = 2 // An activation type that implements the sigmoid activation function. ActivationTypeSigmoid ActivationType = 3 // An activation type that implements the hard sigmoid activation function. ActivationTypeHardSigmoid ActivationType = 4 // An activation type that implements the hyperbolic tangent activation function. ActivationTypeTanh ActivationType = 5 // An activation type that implements the absolute activation function. ActivationTypeAbsolute ActivationType = 6 // An activation type that implements the soft plus activation function. ActivationTypeSoftPlus ActivationType = 7 // An activation type that implements the parametric soft sign activation function. ActivationTypeSoftSign ActivationType = 8 // An activation type that implements the exponential linear unit activation function. ActivationTypeELU ActivationType = 9 // An activation type that implements the ReLUN activation function. ActivationTypeReLUN ActivationType = 10 // An activation type that implements the log sigmoid activation function. ActivationTypeLogSigmoid ActivationType = 11 // An activation type that implements the scaled exponential linear unit activation function. ActivationTypeSELU ActivationType = 12 // An activation type that implements the CELU activation function. ActivationTypeCELU ActivationType = 13 // An activation type that implements the hard shrink activation function. ActivationTypeHardShrink ActivationType = 14 // An activation type that implements the soft shrink activation function. ActivationTypeSoftShrink ActivationType = 15 // An activation type that implements the hyperbolic tangent shrink activation function. ActivationTypeTanhShrink ActivationType = 16 // An activation type that implements the threshold activation function. ActivationTypeThreshold ActivationType = 17 // An activation type that implements the gaussian error linear unit activation function. ActivationTypeGELU ActivationType = 18 // An activation type that implements the hard swish activation function. ActivationTypeHardSwish ActivationType = 19 // An activation type that implements the clamp activation function. ActivationTypeClamp ActivationType = 20 // The count of activation types. ActivationTypeCount ActivationType = 21 )
func (ActivationType) String ¶ added in v0.17.0
func (e ActivationType) String() string
String returns the ActivationType constant's name, or its numeric form when the value is not a known constant.
type AdamOptimizer ¶ added in v0.17.0
type AdamOptimizer struct {
Optimizer
}
AdamOptimizer is an idiomatic wrapper over the Objective-C class MLCAdamOptimizer.
It embeds Optimizer, promoting that type's methods.
An optimizer that represents the adaptive moment estimation algorithm.
func AdamOptimizerFromID ¶ added in v0.17.0
func AdamOptimizerFromID(id objc.ID) *AdamOptimizer
AdamOptimizerFromID adopts an existing Objective-C object as a AdamOptimizer (nil for 0), retaining it and registering a release finalizer.
func NewAdamOptimizer ¶ added in v0.17.0
func NewAdamOptimizer() *AdamOptimizer
NewAdamOptimizer creates a new AdamOptimizer.
func OptimizerWithDescriptor ¶ added in v0.17.0
func OptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *AdamOptimizer
OptimizerWithDescriptor creates an Adam optimizer with the descriptor you specify.
func OptimizerWithDescriptorBeta1Beta2EpsilonTimeStep ¶ added in v0.17.0
func OptimizerWithDescriptorBeta1Beta2EpsilonTimeStep(optimizerDescriptor *OptimizerDescriptor, beta1 float32, beta2 float32, epsilon float32, timeStep int) *AdamOptimizer
OptimizerWithDescriptorBeta1Beta2EpsilonTimeStep creates an Adam optimizer with the values you specify.
func OptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep ¶ added in v0.17.0
func OptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *OptimizerDescriptor, beta1 float32, beta2 float32, epsilon float32, usesAMSGrad bool, timeStep int) *AdamOptimizer
OptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep creates an Adam optimizer with the values you specify.
func (*AdamOptimizer) Beta1 ¶ added in v0.17.0
func (ao *AdamOptimizer) Beta1() float32
Beta1 returns coefficent used for computing running averages of gradient. The default is 0.9.
func (*AdamOptimizer) Beta2 ¶ added in v0.17.0
func (ao *AdamOptimizer) Beta2() float32
Beta2 returns coefficent used for computing running averages of square of gradient. The default is 0.999.
func (*AdamOptimizer) Epsilon ¶ added in v0.17.0
func (ao *AdamOptimizer) Epsilon() float32
Epsilon returns the epsilon.
func (*AdamOptimizer) TimeStep ¶ added in v0.17.0
func (ao *AdamOptimizer) TimeStep() int
TimeStep returns the current timestep used for the update. The default is 1.
func (*AdamOptimizer) UsesAMSGrad ¶ added in v0.17.0
func (ao *AdamOptimizer) UsesAMSGrad() bool
UsesAMSGrad reports whether to use the AMSGrad variant of this algorithm The default is false
func (*AdamOptimizer) WithAppliesGradientClipping ¶ added in v0.17.0
func (ao *AdamOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *AdamOptimizer
WithAppliesGradientClipping sets a Boolean value that indicates whether you apply gradient clipping.
func (*AdamOptimizer) WithLearningRate ¶ added in v0.17.0
func (ao *AdamOptimizer) WithLearningRate(learningRate float32) *AdamOptimizer
WithLearningRate sets the learning rate.
type AdamWOptimizer ¶ added in v0.17.0
type AdamWOptimizer struct {
Optimizer
}
AdamWOptimizer is an idiomatic wrapper over the Objective-C class MLCAdamWOptimizer.
It embeds Optimizer, promoting that type's methods.
An optimizer that represents the Adam algorithm with weight decay.
func AdamWOptimizerFromID ¶ added in v0.17.0
func AdamWOptimizerFromID(id objc.ID) *AdamWOptimizer
AdamWOptimizerFromID adopts an existing Objective-C object as a AdamWOptimizer (nil for 0), retaining it and registering a release finalizer.
func MLCAdamWOptimizerOptimizerWithDescriptor ¶
func MLCAdamWOptimizerOptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *AdamWOptimizer
MLCAdamWOptimizerOptimizerWithDescriptor creates a default optimizer with the descriptor you specify.
func MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep ¶
func MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep(optimizerDescriptor *OptimizerDescriptor, beta1 float32, beta2 float32, epsilon float32, usesAMSGrad bool, timeStep int) *AdamWOptimizer
MLCAdamWOptimizerOptimizerWithDescriptorBeta1Beta2EpsilonUsesAMSGradTimeStep creates an AdamW optimizer with the values you specify.
func NewAdamWOptimizer ¶ added in v0.17.0
func NewAdamWOptimizer() *AdamWOptimizer
NewAdamWOptimizer creates a new AdamWOptimizer.
func (*AdamWOptimizer) Beta1 ¶ added in v0.17.0
func (awo *AdamWOptimizer) Beta1() float32
Beta1 returns coefficent used for computing running averages of gradient. The default is 0.9.
func (*AdamWOptimizer) Beta2 ¶ added in v0.17.0
func (awo *AdamWOptimizer) Beta2() float32
Beta2 returns coefficent used for computing running averages of square of gradient. The default is 0.999.
func (*AdamWOptimizer) Epsilon ¶ added in v0.17.0
func (awo *AdamWOptimizer) Epsilon() float32
Epsilon returns a term added to improve numerical stability. The default is 1e-8.
func (*AdamWOptimizer) TimeStep ¶ added in v0.17.0
func (awo *AdamWOptimizer) TimeStep() int
TimeStep returns the current timestep used for the update. The default is 1.
func (*AdamWOptimizer) UsesAMSGrad ¶ added in v0.17.0
func (awo *AdamWOptimizer) UsesAMSGrad() bool
UsesAMSGrad reports whether to use the AMSGrad variant of this algorithm The default is false
func (*AdamWOptimizer) WithAppliesGradientClipping ¶ added in v0.17.0
func (awo *AdamWOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *AdamWOptimizer
WithAppliesGradientClipping sets a Boolean value that indicates whether you apply gradient clipping.
func (*AdamWOptimizer) WithLearningRate ¶ added in v0.17.0
func (awo *AdamWOptimizer) WithLearningRate(learningRate float32) *AdamWOptimizer
WithLearningRate sets the learning rate.
type ArithmeticLayer ¶ added in v0.17.0
type ArithmeticLayer struct {
Layer
}
ArithmeticLayer is an idiomatic wrapper over the Objective-C class MLCArithmeticLayer.
It embeds Layer, promoting that type's methods.
A layer that performs an arithmetic operation.
func ArithmeticLayerFromID ¶ added in v0.17.0
func ArithmeticLayerFromID(id objc.ID) *ArithmeticLayer
ArithmeticLayerFromID adopts an existing Objective-C object as a ArithmeticLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithOperation ¶ added in v0.17.0
func LayerWithOperation(operation ArithmeticOperation) *ArithmeticLayer
LayerWithOperation creates an arithmetic layer with the operation you specify.
func NewArithmeticLayer ¶ added in v0.17.0
func NewArithmeticLayer() *ArithmeticLayer
NewArithmeticLayer creates a new ArithmeticLayer.
func (*ArithmeticLayer) Operation ¶ added in v0.17.0
func (al *ArithmeticLayer) Operation() ArithmeticOperation
Operation returns the arithmetic operation.
func (*ArithmeticLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (al *ArithmeticLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ArithmeticLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ArithmeticLayer) WithLabel ¶ added in v0.17.0
func (al *ArithmeticLayer) WithLabel(label string) *ArithmeticLayer
WithLabel sets a string that helps identify this layer.
type ArithmeticOperation ¶ added in v0.17.0
type ArithmeticOperation int32
Constants that describe an arithmetic operation.
const ( // Calculates the element-wise sum of the inputs. ArithmeticOperationAdd ArithmeticOperation = 0 // Calculates the element-wise difference between the inputs. ArithmeticOperationSubtract ArithmeticOperation = 1 // Calculates the element-wise product of the inputs. ArithmeticOperationMultiply ArithmeticOperation = 2 // Calculates the element-wise division of the inputs. ArithmeticOperationDivide ArithmeticOperation = 3 // Calculates the element-wise floor of the inputs. ArithmeticOperationFloor ArithmeticOperation = 4 // Calculates the element-wise rounding of the inputs. ArithmeticOperationRound ArithmeticOperation = 5 // Calculates the element-wise ceiling of the inputs. ArithmeticOperationCeil ArithmeticOperation = 6 // Calculates the element-wise square root of the input. ArithmeticOperationSqrt ArithmeticOperation = 7 // Calculates the element-wise reciprocal of the square root of the input. ArithmeticOperationRsqrt ArithmeticOperation = 8 // Calculates the element-wise sine of the input. ArithmeticOperationSin ArithmeticOperation = 9 // Calculates the element-wise cosine of the input. ArithmeticOperationCos ArithmeticOperation = 10 // Calculates the element-wise tangent of the input. ArithmeticOperationTan ArithmeticOperation = 11 // Calculates the element-wise inverse sine of the input. ArithmeticOperationAsin ArithmeticOperation = 12 // Calculates the element-wise inverse cosine of the input. ArithmeticOperationAcos ArithmeticOperation = 13 // Calculates the element-wise inverse tangent of the input. ArithmeticOperationAtan ArithmeticOperation = 14 // Calculates the element-wise hyperbolic sine of the input. ArithmeticOperationSinh ArithmeticOperation = 15 // Calculates the element-wise hyperbolic cosine of the input. ArithmeticOperationCosh ArithmeticOperation = 16 // Calculates the element-wise hyperbolic tangent of the input. ArithmeticOperationTanh ArithmeticOperation = 17 // Calculates the element-wise inverse hyperbolic sine of the input. ArithmeticOperationAsinh ArithmeticOperation = 18 // Calculates the element-wise inverse hyperbolic cosine of the input. ArithmeticOperationAcosh ArithmeticOperation = 19 // Calculates the element-wise inverse hyperbolic tangent of the input. ArithmeticOperationAtanh ArithmeticOperation = 20 // Calculates the element-wise first input raised to the power of the second input. ArithmeticOperationPow ArithmeticOperation = 21 // Calculates the element-wise result of the exponent raised to the power of the input. ArithmeticOperationExp ArithmeticOperation = 22 // Calculates the element-wise result of the number 2 raised to the power of the input. ArithmeticOperationExp2 ArithmeticOperation = 23 // Calculates the element-wise natural logarithm of the input. ArithmeticOperationLog ArithmeticOperation = 24 // Calculates the element-wise base 2 logarithm of the input. ArithmeticOperationLog2 ArithmeticOperation = 25 // Calculates the element-wise product of the inputs, and returns 0 when the result isn’t a number or infinity. ArithmeticOperationMultiplyNoNaN ArithmeticOperation = 26 // Calculates the element-wise division of the inputs, and returns 0 if the denominator is 0. ArithmeticOperationDivideNoNaN ArithmeticOperation = 27 // Calculates the element-wise minimum of the inputs. ArithmeticOperationMin ArithmeticOperation = 28 // Calculates the element-wise maximum the inputs. ArithmeticOperationMax ArithmeticOperation = 29 // The total number of arithmetic operations. ArithmeticOperationCount ArithmeticOperation = 30 )
func (ArithmeticOperation) String ¶ added in v0.17.0
func (e ArithmeticOperation) String() string
String returns the ArithmeticOperation constant's name, or its numeric form when the value is not a known constant.
type BatchNormalizationLayer ¶ added in v0.17.0
type BatchNormalizationLayer struct {
Layer
}
BatchNormalizationLayer is an idiomatic wrapper over the Objective-C class MLCBatchNormalizationLayer.
It embeds Layer, promoting that type's methods.
A layer that normalizes a batch of inputs.
func BatchNormalizationLayerFromID ¶ added in v0.17.0
func BatchNormalizationLayerFromID(id objc.ID) *BatchNormalizationLayer
BatchNormalizationLayerFromID adopts an existing Objective-C object as a BatchNormalizationLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon ¶ added in v0.17.0
func LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon(featureChannelCount int, mean *Tensor, variance *Tensor, beta *Tensor, gamma *Tensor, varianceEpsilon float32) *BatchNormalizationLayer
LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilon creates a batch normalization layer with the number of feature channels, tensors, and variance epsilon you specify.
func LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum ¶ added in v0.17.0
func LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum(featureChannelCount int, mean *Tensor, variance *Tensor, beta *Tensor, gamma *Tensor, varianceEpsilon float32, momentum float32) *BatchNormalizationLayer
LayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum creates a batch normalization layer with the number of feature channels, tensors, variance epsilon, and momentum you specify.
func NewBatchNormalizationLayer ¶ added in v0.17.0
func NewBatchNormalizationLayer() *BatchNormalizationLayer
NewBatchNormalizationLayer creates a new BatchNormalizationLayer.
func (*BatchNormalizationLayer) Beta ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) Beta() *Tensor
Beta returns the beta tensor
func (*BatchNormalizationLayer) BetaParameter ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) BetaParameter() *TensorParameter
BetaParameter returns the beta tensor parameter used for optimizer update
func (*BatchNormalizationLayer) FeatureChannelCount ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) FeatureChannelCount() int
FeatureChannelCount returns the number of feature channels
func (*BatchNormalizationLayer) Gamma ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) Gamma() *Tensor
Gamma returns the gamma tensor
func (*BatchNormalizationLayer) GammaParameter ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) GammaParameter() *TensorParameter
GammaParameter returns the gamma tensor parameter used for optimizer update
func (*BatchNormalizationLayer) Mean ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) Mean() *Tensor
Mean returns the mean tensor
func (*BatchNormalizationLayer) Momentum ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) Momentum() float32
Momentum returns the value used for the running mean and variance computation The default is 0.99f.
func (*BatchNormalizationLayer) Variance ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) Variance() *Tensor
Variance returns the variance tensor
func (*BatchNormalizationLayer) VarianceEpsilon ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) VarianceEpsilon() float32
VarianceEpsilon returns a value used for numerical stability
func (*BatchNormalizationLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *BatchNormalizationLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*BatchNormalizationLayer) WithLabel ¶ added in v0.17.0
func (bnl *BatchNormalizationLayer) WithLabel(label string) *BatchNormalizationLayer
WithLabel sets a string that helps identify this layer.
type ComparisonLayer ¶ added in v0.17.0
type ComparisonLayer struct {
Layer
}
ComparisonLayer is an idiomatic wrapper over the Objective-C class MLCComparisonLayer.
It embeds Layer, promoting that type's methods.
A layer that performs elementwise comparison of two tensors.
func ComparisonLayerFromID ¶ added in v0.17.0
func ComparisonLayerFromID(id objc.ID) *ComparisonLayer
ComparisonLayerFromID adopts an existing Objective-C object as a ComparisonLayer (nil for 0), retaining it and registering a release finalizer.
func MLCComparisonLayerLayerWithOperation ¶
func MLCComparisonLayerLayerWithOperation(operation ComparisonOperation) *ComparisonLayer
MLCComparisonLayerLayerWithOperation creates a comparison layer with the operation you specify.
func NewComparisonLayer ¶ added in v0.17.0
func NewComparisonLayer() *ComparisonLayer
NewComparisonLayer creates a new ComparisonLayer.
func (*ComparisonLayer) Operation ¶ added in v0.17.0
func (cl *ComparisonLayer) Operation() ComparisonOperation
Operation returns the operation.
func (*ComparisonLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (cl *ComparisonLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ComparisonLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ComparisonLayer) WithLabel ¶ added in v0.17.0
func (cl *ComparisonLayer) WithLabel(label string) *ComparisonLayer
WithLabel sets a string that helps identify this layer.
type ComparisonOperation ¶ added in v0.17.0
type ComparisonOperation int32
A comparison operation.
const ( ComparisonOperationEqual ComparisonOperation = 0 ComparisonOperationNotEqual ComparisonOperation = 1 ComparisonOperationLess ComparisonOperation = 2 ComparisonOperationGreater ComparisonOperation = 3 ComparisonOperationLessOrEqual ComparisonOperation = 4 ComparisonOperationGreaterOrEqual ComparisonOperation = 5 ComparisonOperationLogicalAND ComparisonOperation = 6 ComparisonOperationLogicalOR ComparisonOperation = 7 ComparisonOperationLogicalNOT ComparisonOperation = 8 ComparisonOperationLogicalNAND ComparisonOperation = 9 ComparisonOperationLogicalNOR ComparisonOperation = 10 ComparisonOperationLogicalXOR ComparisonOperation = 11 // A number that represents the operation count. ComparisonOperationCount ComparisonOperation = 12 )
func (ComparisonOperation) String ¶ added in v0.17.0
func (e ComparisonOperation) String() string
String returns the ComparisonOperation constant's name, or its numeric form when the value is not a known constant.
type ConcatenationLayer ¶ added in v0.17.0
type ConcatenationLayer struct {
Layer
}
ConcatenationLayer is an idiomatic wrapper over the Objective-C class MLCConcatenationLayer.
It embeds Layer, promoting that type's methods.
A layer that combines tensors into a single tensor.
func ConcatenationLayerFromID ¶ added in v0.17.0
func ConcatenationLayerFromID(id objc.ID) *ConcatenationLayer
ConcatenationLayerFromID adopts an existing Objective-C object as a ConcatenationLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithDimension ¶ added in v0.17.0
func LayerWithDimension(dimension int) *ConcatenationLayer
LayerWithDimension creates a concatenation layer with the dimension you specify.
func MLCConcatenationLayerLayer ¶
func MLCConcatenationLayerLayer() *ConcatenationLayer
MLCConcatenationLayerLayer creates a concatenation layer with a dimension value of 1, which typically represents feature channels.
func NewConcatenationLayer ¶ added in v0.17.0
func NewConcatenationLayer() *ConcatenationLayer
NewConcatenationLayer creates a new ConcatenationLayer.
func (*ConcatenationLayer) Dimension ¶ added in v0.17.0
func (cl *ConcatenationLayer) Dimension() int
Dimension returns the dimension (or axis) along which to concatenate tensors The default value is 1 (which typically represents features channels)
func (*ConcatenationLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (cl *ConcatenationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ConcatenationLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ConcatenationLayer) WithLabel ¶ added in v0.17.0
func (cl *ConcatenationLayer) WithLabel(label string) *ConcatenationLayer
WithLabel sets a string that helps identify this layer.
type ConvolutionDescriptor ¶ added in v0.17.0
ConvolutionDescriptor is an idiomatic wrapper over the Objective-C class MLCConvolutionDescriptor.
A configuration object you use to create a convolution or fully connected layer.
func ConvolutionDescriptorFromID ¶ added in v0.17.0
func ConvolutionDescriptorFromID(id objc.ID) *ConvolutionDescriptor
ConvolutionDescriptorFromID adopts an existing Objective-C object as a ConvolutionDescriptor (nil for 0), retaining it and registering a release finalizer.
func ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, outputFeatureChannelCount int, groupCount int, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes creates a convolution transpose descriptor with the kernel and padding options, number of feature channels and groups, and dilation rates you specify.
func ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, outputFeatureChannelCount int, strides []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
ConvolutionTransposeDescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes creates a convolution transpose descriptor with the kernel sizes, number of feature channels, strides, and padding options you specify.
func ConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount ¶ added in v0.17.0
func ConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth int, kernelHeight int, inputFeatureChannelCount int, outputFeatureChannelCount int) *ConvolutionDescriptor
ConvolutionTransposeDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount creates a descriptor for convolution transpose with the kernel sizes and number of feature channels you specify.
func DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, channelMultiplier int, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesDilationRatesPaddingPolicyPaddingSizes creates a convolution descriptor with the kernel and padding options, number of input channels, channel multiplier, and dilation rates you specify.
func DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, channelMultiplier int, strides []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
DepthwiseConvolutionDescriptorWithKernelSizesInputFeatureChannelCountChannelMultiplierStridesPaddingPolicyPaddingSizes creates a depthwise convolution descriptor with the kernel and padding options, number of input feature channels, and channel multiplier you specify.
func DepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier ¶ added in v0.17.0
func DepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier(kernelWidth int, kernelHeight int, inputFeatureChannelCount int, channelMultiplier int) *ConvolutionDescriptor
DepthwiseConvolutionDescriptorWithKernelWidthKernelHeightInputFeatureChannelCountChannelMultiplier creates a descriptor for depthwise convolution with the kernel sizes, number of input feature channels, and channel multiplier you specify.
func DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, outputFeatureChannelCount int, groupCount int, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes creates a convolution descriptor with the kernel and padding options, number of feature channels and groups, and dilation rates you specify.
func DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, inputFeatureChannelCount int, outputFeatureChannelCount int, strides []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
DescriptorWithKernelSizesInputFeatureChannelCountOutputFeatureChannelCountStridesPaddingPolicyPaddingSizes creates a convolution descriptor with the kernel sizes, number of feature channels, strides, padding policy, and padding sizes you specify.
func DescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount ¶ added in v0.17.0
func DescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount(kernelWidth int, kernelHeight int, inputFeatureChannelCount int, outputFeatureChannelCount int) *ConvolutionDescriptor
DescriptorWithKernelWidthKernelHeightInputFeatureChannelCountOutputFeatureChannelCount creates a convolution descriptor with the kernel sizes and number of feature channels you specify.
func DescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func DescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes(convolutionType ConvolutionType, kernelSizes []*foundation.Number, inputFeatureChannelCount int, outputFeatureChannelCount int, groupCount int, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *ConvolutionDescriptor
DescriptorWithTypeKernelSizesInputFeatureChannelCountOutputFeatureChannelCountGroupCountStridesDilationRatesPaddingPolicyPaddingSizes creates a descriptor with the type, kernel sizes, number of feature channels and groups, strides, dilation rates, and padding policy you specify.
func NewConvolutionDescriptor ¶ added in v0.17.0
func NewConvolutionDescriptor() *ConvolutionDescriptor
NewConvolutionDescriptor creates a new ConvolutionDescriptor.
func (*ConvolutionDescriptor) ConvolutionType ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) ConvolutionType() ConvolutionType
ConvolutionType returns the type of convolution.
func (*ConvolutionDescriptor) Description ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) Description() string
Description returns the object's -description text.
func (*ConvolutionDescriptor) DilationRateInX ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) DilationRateInX() int
DilationRateInX returns the dilation rate i.e. stride of elements in the kernel in x.
func (*ConvolutionDescriptor) DilationRateInY ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) DilationRateInY() int
DilationRateInY returns the dilation rate i.e. stride of elements in the kernel in y.
func (*ConvolutionDescriptor) GroupCount ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) GroupCount() int
GroupCount returns number of blocked connections from input channels to output channels
func (*ConvolutionDescriptor) InputFeatureChannelCount ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) InputFeatureChannelCount() int
InputFeatureChannelCount returns number of channels in the input tensor
func (*ConvolutionDescriptor) IsConvolutionTranspose ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) IsConvolutionTranspose() bool
IsConvolutionTranspose reports whether a flag to indicate if this is a convolution transpose
func (*ConvolutionDescriptor) IsEqual ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*ConvolutionDescriptor) IsKind ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*ConvolutionDescriptor) KernelHeight ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) KernelHeight() int
KernelHeight returns the convolution kernel size in y.
func (*ConvolutionDescriptor) KernelWidth ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) KernelWidth() int
KernelWidth returns the convolution kernel size in x.
func (*ConvolutionDescriptor) OutputFeatureChannelCount ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) OutputFeatureChannelCount() int
OutputFeatureChannelCount returns number of channels in the output tensor
func (*ConvolutionDescriptor) PaddingPolicy ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) PaddingPolicy() PaddingPolicy
PaddingPolicy returns the padding policy to use.
func (*ConvolutionDescriptor) PaddingSizeInX ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) PaddingSizeInX() int
PaddingSizeInX returns the pooling size in x (left and right) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*ConvolutionDescriptor) PaddingSizeInY ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) PaddingSizeInY() int
PaddingSizeInY returns the pooling size in y (top and bottom) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*ConvolutionDescriptor) StrideInX ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) StrideInX() int
StrideInX returns the stride of the kernel in x.
func (*ConvolutionDescriptor) StrideInY ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) StrideInY() int
StrideInY returns the stride of the kernel in y.
func (*ConvolutionDescriptor) String ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*ConvolutionDescriptor) UsesDepthwiseConvolution ¶ added in v0.17.0
func (cd *ConvolutionDescriptor) UsesDepthwiseConvolution() bool
UsesDepthwiseConvolution reports whether a flag to indicate depthwise convolution
type ConvolutionLayer ¶ added in v0.17.0
type ConvolutionLayer struct {
Layer
}
ConvolutionLayer is an idiomatic wrapper over the Objective-C class MLCConvolutionLayer.
It embeds Layer, promoting that type's methods.
A layer that applies a convolution over a signal.
func ConvolutionLayerFromID ¶ added in v0.17.0
func ConvolutionLayerFromID(id objc.ID) *ConvolutionLayer
ConvolutionLayerFromID adopts an existing Objective-C object as a ConvolutionLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithWeightsBiasesDescriptor ¶ added in v0.17.0
func LayerWithWeightsBiasesDescriptor(weights *Tensor, biases *Tensor, descriptor *ConvolutionDescriptor) *ConvolutionLayer
LayerWithWeightsBiasesDescriptor creates a convolution layer with the weights, biases, and descriptor you specify.
func NewConvolutionLayer ¶ added in v0.17.0
func NewConvolutionLayer() *ConvolutionLayer
NewConvolutionLayer creates a new ConvolutionLayer.
func (*ConvolutionLayer) Biases ¶ added in v0.17.0
func (cl *ConvolutionLayer) Biases() *Tensor
Biases returns the bias tensor used by the convolution layer
func (*ConvolutionLayer) BiasesParameter ¶ added in v0.17.0
func (cl *ConvolutionLayer) BiasesParameter() *TensorParameter
BiasesParameter returns the bias tensor parameter used for optimizer update
func (*ConvolutionLayer) Descriptor ¶ added in v0.17.0
func (cl *ConvolutionLayer) Descriptor() *ConvolutionDescriptor
Descriptor returns the convolution descriptor
func (*ConvolutionLayer) Weights ¶ added in v0.17.0
func (cl *ConvolutionLayer) Weights() *Tensor
Weights returns the weights tensor used by the convolution layer
func (*ConvolutionLayer) WeightsParameter ¶ added in v0.17.0
func (cl *ConvolutionLayer) WeightsParameter() *TensorParameter
WeightsParameter returns the weights tensor parameter used for optimizer update
func (*ConvolutionLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (cl *ConvolutionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ConvolutionLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ConvolutionLayer) WithLabel ¶ added in v0.17.0
func (cl *ConvolutionLayer) WithLabel(label string) *ConvolutionLayer
WithLabel sets a string that helps identify this layer.
type ConvolutionType ¶ added in v0.17.0
type ConvolutionType int32
The convolution type specified for a convolution layer.
const ( // The standard convolution type. ConvolutionTypeStandard ConvolutionType = 0 // The transposed convolution type. ConvolutionTypeTransposed ConvolutionType = 1 // The depthwise convolution type. ConvolutionTypeDepthwise ConvolutionType = 2 )
func (ConvolutionType) String ¶ added in v0.17.0
func (e ConvolutionType) String() string
String returns the ConvolutionType constant's name, or its numeric form when the value is not a known constant.
type DataType ¶ added in v0.17.0
type DataType int32
A tensor data type.
const ( DataTypeInvalid DataType = 0 // The 32-bit floating-point data type. DataTypeFloat32 DataType = 1 // The 16-bit floating-point data type. DataTypeFloat16 DataType = 3 // The Boolean data type. DataTypeBoolean DataType = 4 // The 64-bit integer data type. DataTypeInt64 DataType = 5 // The 32-bit integer data type. DataTypeInt32 DataType = 7 // The 8-bit integer data type. DataTypeInt8 DataType = 8 // The 8-bit unsigned integer data type. DataTypeUInt8 DataType = 9 DataTypeCount DataType = 10 )
type Device ¶ added in v0.17.0
Device is an idiomatic wrapper over the Objective-C class MLCDevice.
An object that represents the CPU or one or more GPUs the framework uses to execute a neural network.
func AneDevice ¶ added in v0.17.0
func AneDevice() *Device
AneDevice creates a device that uses the Apple Neural Engine, if one exists.
func CpuDevice ¶ added in v0.17.0
func CpuDevice() *Device
CpuDevice creates a device that uses the CPU.
func DeviceFromID ¶ added in v0.17.0
DeviceFromID adopts an existing Objective-C object as a Device (nil for 0), retaining it and registering a release finalizer.
func DeviceWithGPUDevices ¶ added in v0.17.0
DeviceWithGPUDevices creates a device using the GPUs you specify.
func DeviceWithType ¶ added in v0.17.0
func DeviceWithType(type_ DeviceType) *Device
DeviceWithType creates a device of the type you specify.
func DeviceWithTypeSelectsMultipleComputeDevices ¶ added in v0.17.0
func DeviceWithTypeSelectsMultipleComputeDevices(type_ DeviceType, selectsMultipleComputeDevices bool) *Device
DeviceWithTypeSelectsMultipleComputeDevices creates a device that you can configure to use multiple compute devices.
func GpuDevice ¶ added in v0.17.0
func GpuDevice() *Device
GpuDevice creates a device that uses a GPU, if one exists.
func (*Device) ActualDeviceType ¶ added in v0.17.0
func (d *Device) ActualDeviceType() DeviceType
ActualDeviceType returns the specific device selected. 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 (*Device) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Device) GPUDevices ¶ added in v0.17.0
GPUDevices returns the GPU devices.
func (*Device) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Device) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Device) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Device) Type ¶ added in v0.17.0
func (d *Device) Type() DeviceType
Type returns the type specified when the device is created 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 DeviceType ¶ added in v0.17.0
type DeviceType int32
A device type for execution of a neural network.
const ( // A device type that represents the CPU. DeviceTypeCPU DeviceType = 0 // A device type that represents the GPU. DeviceTypeGPU DeviceType = 1 // A device type that represents either the CPU or GPU. DeviceTypeAny DeviceType = 2 // A device type that represents the Apple Neural Engine. DeviceTypeANE DeviceType = 3 // A number that represents the number of device types. DeviceTypeCount DeviceType = 4 )
func (DeviceType) String ¶ added in v0.17.0
func (e DeviceType) String() string
String returns the DeviceType constant's name, or its numeric form when the value is not a known constant.
type DispatchAutoreleaseFrequency ¶ added in v0.17.0
type DispatchAutoreleaseFrequency uint64
const ( DispatchAutoreleaseFrequencyInherit DispatchAutoreleaseFrequency = 0 DispatchAutoreleaseFrequencyWorkItem DispatchAutoreleaseFrequency = 1 DispatchAutoreleaseFrequencyNever DispatchAutoreleaseFrequency = 2 )
func (DispatchAutoreleaseFrequency) String ¶ added in v0.17.0
func (e DispatchAutoreleaseFrequency) String() string
String returns the DispatchAutoreleaseFrequency constant's name, or its numeric form when the value is not a known constant.
type DispatchBlockFlags ¶ added in v0.17.0
type DispatchBlockFlags uint64
Bitmask — values may be combined with |.
const ( DispatchBlockFlagsBarrier DispatchBlockFlags = 1 DispatchBlockFlagsDetached DispatchBlockFlags = 2 DispatchBlockFlagsAssignCurrent DispatchBlockFlags = 4 DispatchBlockFlagsNoQosClass DispatchBlockFlags = 8 DispatchBlockFlagsInheritQosClass DispatchBlockFlags = 16 DispatchBlockFlagsEnforceQosClass DispatchBlockFlags = 32 )
func (DispatchBlockFlags) String ¶ added in v0.17.0
func (e DispatchBlockFlags) String() string
String returns the DispatchBlockFlags constant's name, or its numeric form when the value is not a known constant.
type DropoutLayer ¶ added in v0.17.0
type DropoutLayer struct {
Layer
}
DropoutLayer is an idiomatic wrapper over the Objective-C class MLCDropoutLayer.
It embeds Layer, promoting that type's methods.
A layer that deactivates neurons randomly to avoid overfitting.
func DropoutLayerFromID ¶ added in v0.17.0
func DropoutLayerFromID(id objc.ID) *DropoutLayer
DropoutLayerFromID adopts an existing Objective-C object as a DropoutLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithRateSeed ¶ added in v0.17.0
func LayerWithRateSeed(rate float32, seed int) *DropoutLayer
LayerWithRateSeed creates a dropout layer with the probability rate and random number generator seed you specify.
func NewDropoutLayer ¶ added in v0.17.0
func NewDropoutLayer() *DropoutLayer
NewDropoutLayer creates a new DropoutLayer.
func (*DropoutLayer) Rate ¶ added in v0.17.0
func (dl *DropoutLayer) Rate() float32
Rate returns the probability that each element is dropped
func (*DropoutLayer) Seed ¶ added in v0.17.0
func (dl *DropoutLayer) Seed() int
Seed returns the initial seed used to generate random numbers
func (*DropoutLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (dl *DropoutLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *DropoutLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*DropoutLayer) WithLabel ¶ added in v0.17.0
func (dl *DropoutLayer) WithLabel(label string) *DropoutLayer
WithLabel sets a string that helps identify this layer.
type EmbeddingDescriptor ¶ added in v0.17.0
EmbeddingDescriptor is an idiomatic wrapper over the Objective-C class MLCEmbeddingDescriptor.
A configuration object you use to create an embedding layer.
func DescriptorWithEmbeddingCountEmbeddingDimension ¶ added in v0.17.0
func DescriptorWithEmbeddingCountEmbeddingDimension(embeddingCount obj.Object, embeddingDimension obj.Object) *EmbeddingDescriptor
DescriptorWithEmbeddingCountEmbeddingDimension creates an embedding descriptor with the size of the dictionary and dimension of embedding vectors you specify.
func DescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency ¶ added in v0.17.0
func DescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency(embeddingCount obj.Object, embeddingDimension obj.Object, paddingIndex obj.Object, maximumNorm obj.Object, pNorm obj.Object, scalesGradientByFrequency bool) *EmbeddingDescriptor
DescriptorWithEmbeddingCountEmbeddingDimensionPaddingIndexMaximumNormPNormScalesGradientByFrequency creates a new embedding descriptor with the size and dimension of embedding vectors, padding index, and norm and scaling options that you specify.
func EmbeddingDescriptorFromID ¶ added in v0.17.0
func EmbeddingDescriptorFromID(id objc.ID) *EmbeddingDescriptor
EmbeddingDescriptorFromID adopts an existing Objective-C object as a EmbeddingDescriptor (nil for 0), retaining it and registering a release finalizer.
func NewEmbeddingDescriptor ¶ added in v0.17.0
func NewEmbeddingDescriptor() *EmbeddingDescriptor
NewEmbeddingDescriptor creates a new EmbeddingDescriptor.
func (*EmbeddingDescriptor) Description ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) Description() string
Description returns the object's -description text.
func (*EmbeddingDescriptor) EmbeddingCount ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) EmbeddingCount() *foundation.Number
EmbeddingCount returns the size of the dictionary
func (*EmbeddingDescriptor) EmbeddingDimension ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) EmbeddingDimension() *foundation.Number
EmbeddingDimension returns the dimension of embedding vectors
func (*EmbeddingDescriptor) IsEqual ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*EmbeddingDescriptor) IsKind ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*EmbeddingDescriptor) MaximumNorm ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) MaximumNorm() *foundation.Number
MaximumNorm returns 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 (*EmbeddingDescriptor) PNorm ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) PNorm() *foundation.Number
PNorm returns a float, the p of the Lp norm, can be set to infinity norm by [NSNumber numberWithFloat:INFINITY]. Default=2.0
func (*EmbeddingDescriptor) PaddingIndex ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) PaddingIndex() *foundation.Number
PaddingIndex returns if set, the embedding vector at paddingIndex is initialized with zero and will not be updated in gradient pass, Default=nil
func (*EmbeddingDescriptor) ScalesGradientByFrequency ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) ScalesGradientByFrequency() bool
ScalesGradientByFrequency reports whether if set, the gradients are scaled by the inverse of the frequency of the words in batch before the weight update. Default=NO
func (*EmbeddingDescriptor) String ¶ added in v0.17.0
func (ed *EmbeddingDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type EmbeddingLayer ¶ added in v0.17.0
type EmbeddingLayer struct {
Layer
}
EmbeddingLayer is an idiomatic wrapper over the Objective-C class MLCEmbeddingLayer.
It embeds Layer, promoting that type's methods.
A layer that stores a word embedding.
func EmbeddingLayerFromID ¶ added in v0.17.0
func EmbeddingLayerFromID(id objc.ID) *EmbeddingLayer
EmbeddingLayerFromID adopts an existing Objective-C object as a EmbeddingLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithDescriptorWeights ¶ added in v0.17.0
func LayerWithDescriptorWeights(descriptor *EmbeddingDescriptor, weights *Tensor) *EmbeddingLayer
LayerWithDescriptorWeights creates an embedding layer with the descriptor and word embedding weights tensor you specify.
func NewEmbeddingLayer ¶ added in v0.17.0
func NewEmbeddingLayer() *EmbeddingLayer
NewEmbeddingLayer creates a new EmbeddingLayer.
func (*EmbeddingLayer) Descriptor ¶ added in v0.17.0
func (el *EmbeddingLayer) Descriptor() *EmbeddingDescriptor
Descriptor returns the descriptor.
func (*EmbeddingLayer) Weights ¶ added in v0.17.0
func (el *EmbeddingLayer) Weights() *Tensor
Weights returns the array of word embeddings
func (*EmbeddingLayer) WeightsParameter ¶ added in v0.17.0
func (el *EmbeddingLayer) WeightsParameter() *TensorParameter
WeightsParameter returns the weights tensor parameter used for optimizer update
func (*EmbeddingLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (el *EmbeddingLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *EmbeddingLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*EmbeddingLayer) WithLabel ¶ added in v0.17.0
func (el *EmbeddingLayer) WithLabel(label string) *EmbeddingLayer
WithLabel sets a string that helps identify this layer.
type ExecutionOptions ¶ added in v0.17.0
type ExecutionOptions uint64
A bitmask that specifies the options you use when executing a graph. Bitmask — values may be combined with |.
const ( // The option to execute the graph in the most efficient way possible. ExecutionOptionsNone ExecutionOptions = 0 // The option to skip writing input data to device memory. ExecutionOptionsSkipWritingInputDataToDevice ExecutionOptions = 1 // The option to execute the graph synchronously. ExecutionOptionsSynchronous ExecutionOptions = 2 // The option to return profiling information in the callback before returning from execution. ExecutionOptionsProfiling ExecutionOptions = 4 // The option to execute the forward pass for inference only. ExecutionOptionsForwardForInference ExecutionOptions = 8 // The option to enable additional per-layer profiling information using signposts. ExecutionOptionsPerLayerProfiling ExecutionOptions = 16 )
func (ExecutionOptions) String ¶ added in v0.17.0
func (e ExecutionOptions) String() string
String returns the ExecutionOptions constant's name, or its numeric form when the value is not a known constant.
type FilesecProperty ¶ added in v0.17.0
type FilesecProperty int32
const ( FilesecPropertyOwner FilesecProperty = 1 FilesecPropertyGroup FilesecProperty = 2 FilesecPropertyUUID FilesecProperty = 3 FilesecPropertyMode FilesecProperty = 4 FilesecPropertyACL FilesecProperty = 5 FilesecPropertyGrpuuid FilesecProperty = 6 FilesecPropertyACLRaw FilesecProperty = 100 FilesecPropertyACLAllocsize FilesecProperty = 101 )
func (FilesecProperty) String ¶ added in v0.17.0
func (e FilesecProperty) String() string
String returns the FilesecProperty constant's name, or its numeric form when the value is not a known constant.
type FullyConnectedLayer ¶ added in v0.17.0
type FullyConnectedLayer struct {
Layer
}
FullyConnectedLayer is an idiomatic wrapper over the Objective-C class MLCFullyConnectedLayer.
It embeds Layer, promoting that type's methods.
A layer that connects each input to each output within its layer.
func FullyConnectedLayerFromID ¶ added in v0.17.0
func FullyConnectedLayerFromID(id objc.ID) *FullyConnectedLayer
FullyConnectedLayerFromID adopts an existing Objective-C object as a FullyConnectedLayer (nil for 0), retaining it and registering a release finalizer.
func MLCFullyConnectedLayerLayerWithWeightsBiasesDescriptor ¶
func MLCFullyConnectedLayerLayerWithWeightsBiasesDescriptor(weights *Tensor, biases *Tensor, descriptor *ConvolutionDescriptor) *FullyConnectedLayer
MLCFullyConnectedLayerLayerWithWeightsBiasesDescriptor creates a fully connected layer with the weights, biases, and convolution descriptor you specify.
func NewFullyConnectedLayer ¶ added in v0.17.0
func NewFullyConnectedLayer() *FullyConnectedLayer
NewFullyConnectedLayer creates a new FullyConnectedLayer.
func (*FullyConnectedLayer) Biases ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) Biases() *Tensor
Biases returns the bias tensor used by the convolution layer
func (*FullyConnectedLayer) BiasesParameter ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) BiasesParameter() *TensorParameter
BiasesParameter returns the bias tensor parameter used for optimizer update
func (*FullyConnectedLayer) Descriptor ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) Descriptor() *ConvolutionDescriptor
Descriptor returns the convolution descriptor
func (*FullyConnectedLayer) Weights ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) Weights() *Tensor
Weights returns the weights tensor used by the convolution layer
func (*FullyConnectedLayer) WeightsParameter ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) WeightsParameter() *TensorParameter
WeightsParameter returns the weights tensor parameter used for optimizer update
func (*FullyConnectedLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *FullyConnectedLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*FullyConnectedLayer) WithLabel ¶ added in v0.17.0
func (fcl *FullyConnectedLayer) WithLabel(label string) *FullyConnectedLayer
WithLabel sets a string that helps identify this layer.
type GatherLayer ¶ added in v0.17.0
type GatherLayer struct {
Layer
}
GatherLayer is an idiomatic wrapper over the Objective-C class MLCGatherLayer.
It embeds Layer, promoting that type's methods.
A layer that fetches data at the locations you specify.
func GatherLayerFromID ¶ added in v0.17.0
func GatherLayerFromID(id objc.ID) *GatherLayer
GatherLayerFromID adopts an existing Objective-C object as a GatherLayer (nil for 0), retaining it and registering a release finalizer.
func MLCGatherLayerLayerWithDimension ¶
func MLCGatherLayerLayerWithDimension(dimension int) *GatherLayer
MLCGatherLayerLayerWithDimension creates a gather layer with the dimension you specify.
func NewGatherLayer ¶ added in v0.17.0
func NewGatherLayer() *GatherLayer
NewGatherLayer creates a new GatherLayer.
func (*GatherLayer) Dimension ¶ added in v0.17.0
func (gl *GatherLayer) Dimension() int
Dimension returns the dimension along which to index
func (*GatherLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (gl *GatherLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *GatherLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*GatherLayer) WithLabel ¶ added in v0.17.0
func (gl *GatherLayer) WithLabel(label string) *GatherLayer
WithLabel sets a string that helps identify this layer.
type GradientClippingType ¶ added in v0.17.0
type GradientClippingType int32
A clipping type the system applies to a gradient.
const ( // An option that clips by value. GradientClippingTypeByValue GradientClippingType = 0 // An option that clips by norm. GradientClippingTypeByNorm GradientClippingType = 1 // An option that clips by global norm. GradientClippingTypeByGlobalNorm GradientClippingType = 2 )
func (GradientClippingType) String ¶ added in v0.17.0
func (e GradientClippingType) String() string
String returns the GradientClippingType constant's name, or its numeric form when the value is not a known constant.
type GramMatrixLayer ¶ added in v0.17.0
type GramMatrixLayer struct {
Layer
}
GramMatrixLayer is an idiomatic wrapper over the Objective-C class MLCGramMatrixLayer.
It embeds Layer, promoting that type's methods.
A layer that computes the uncentered cross-correlation values between the spacial planes of each feature channel of a tensor.
func GramMatrixLayerFromID ¶ added in v0.17.0
func GramMatrixLayerFromID(id objc.ID) *GramMatrixLayer
GramMatrixLayerFromID adopts an existing Objective-C object as a GramMatrixLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithScale ¶ added in v0.17.0
func LayerWithScale(scale float32) *GramMatrixLayer
LayerWithScale creates a gram matrix layer with the scaling factor you specify.
func NewGramMatrixLayer ¶ added in v0.17.0
func NewGramMatrixLayer() *GramMatrixLayer
NewGramMatrixLayer creates a new GramMatrixLayer.
func (*GramMatrixLayer) Scale ¶ added in v0.17.0
func (gml *GramMatrixLayer) Scale() float32
Scale returns the scale factor
func (*GramMatrixLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (gml *GramMatrixLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *GramMatrixLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*GramMatrixLayer) WithLabel ¶ added in v0.17.0
func (gml *GramMatrixLayer) WithLabel(label string) *GramMatrixLayer
WithLabel sets a string that helps identify this layer.
type Graph ¶ added in v0.17.0
Graph is an idiomatic wrapper over the Objective-C class MLCGraph.
Graph is an abstract base — you do not construct it directly. Construct one of InferenceGraph, TrainingGraph and pass it where a Graph is accepted.
A graph of layers you use to build a training or inference graph.
func GraphFromID ¶ added in v0.17.0
GraphFromID adopts an existing Objective-C object as a Graph (nil for 0), retaining it and registering a release finalizer.
func (*Graph) BindAndWriteDataForInputsToDeviceBatchSizeSynchronous ¶ added in v0.17.0
func (g *Graph) BindAndWriteDataForInputsToDeviceBatchSizeSynchronous(inputsData map[string]*TensorData, inputTensors map[string]*Tensor, device *Device, batchSize int, synchronous bool) bool
BindAndWriteDataForInputsToDeviceBatchSizeSynchronous associates the given data with the input tensors, and if the device is a GPU, also copies the data to the device memory.
func (*Graph) BindAndWriteDataForInputsToDeviceSynchronous ¶ added in v0.17.0
func (g *Graph) BindAndWriteDataForInputsToDeviceSynchronous(inputsData map[string]*TensorData, inputTensors map[string]*Tensor, device *Device, synchronous bool) bool
BindAndWriteDataForInputsToDeviceSynchronous associates the given data with the input tensors, and if the device is a GPU, also copies the data to the device memory.
func (*Graph) ConcatenateWithSourcesDimension ¶ added in v0.17.0
ConcatenateWithSourcesDimension adds a new concatenation layer to the graph using the source tensors and concatenation dimension you specify.
func (*Graph) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Graph) Device ¶ added in v0.17.0
Device returns the device to be used when compiling and executing a graph
func (*Graph) GatherWithDimensionSourceIndices ¶ added in v0.17.0
func (g *Graph) GatherWithDimensionSourceIndices(dimension int, source *Tensor, indices *Tensor) *Tensor
GatherWithDimensionSourceIndices adds a gather layer to the graph using the source tensor, dimension along which to index, and the indices you specify.
func (*Graph) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Graph) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Graph) Layers ¶ added in v0.17.0
Layers returns layers in the graph
Layers returns the collection as a Go slice.
func (*Graph) NodeWithLayerSource ¶ added in v0.17.0
NodeWithLayerSource adds the layer and source tensor that you specify to the graph.
func (*Graph) NodeWithLayerSources ¶ added in v0.17.0
NodeWithLayerSources adds the layer and source tensors that you specify to the graph.
func (*Graph) NodeWithLayerSourcesDisableUpdate ¶ added in v0.17.0
func (g *Graph) NodeWithLayerSourcesDisableUpdate(layer *Layer, sources []*Tensor, disableUpdate bool) *Tensor
NodeWithLayerSourcesDisableUpdate adds the layer, source tensors, and option to disable optimizer updates that you specify to the graph.
func (*Graph) NodeWithLayerSourcesLossLabels ¶ added in v0.17.0
func (g *Graph) NodeWithLayerSourcesLossLabels(layer *Layer, sources []*Tensor, lossLabels []*Tensor) *Tensor
NodeWithLayerSourcesLossLabels adds the layer, sources, and loss labels tensors that you specify to the graph.
func (*Graph) ReshapeWithShapeSource ¶ added in v0.17.0
func (g *Graph) ReshapeWithShapeSource(shape []*foundation.Number, source *Tensor) *Tensor
ReshapeWithShapeSource adds a new reshape layer to the graph using the shape and source tensor you specify.
func (*Graph) ResultTensorsForLayer ¶ added in v0.17.0
ResultTensorsForLayer gets the result tensors for a layer in the training graph.
func (*Graph) ScatterWithDimensionSourceIndicesCopyFromReductionType ¶ added in v0.17.0
func (g *Graph) ScatterWithDimensionSourceIndicesCopyFromReductionType(dimension int, source *Tensor, indices *Tensor, copyFrom *Tensor, reductionType ReductionType) *Tensor
ScatterWithDimensionSourceIndicesCopyFromReductionType adds a scatter layer to the graph.
func (*Graph) SelectWithSourcesCondition ¶ added in v0.17.0
SelectWithSourcesCondition adds a select layer to the graph using the condition mask and source tensors you specify.
func (*Graph) SourceTensorsForLayer ¶ added in v0.17.0
SourceTensorsForLayer gets the source tensors for a layer in the training graph.
func (*Graph) SplitWithSourceSplitCountDimension ¶ added in v0.17.0
func (g *Graph) SplitWithSourceSplitCountDimension(source *Tensor, splitCount int, dimension int) []*Tensor
SplitWithSourceSplitCountDimension 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 (*Graph) SplitWithSourceSplitSectionLengthsDimension ¶ added in v0.17.0
func (g *Graph) SplitWithSourceSplitSectionLengthsDimension(source *Tensor, splitSectionLengths []*foundation.Number, dimension int) []*Tensor
SplitWithSourceSplitSectionLengthsDimension 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 (*Graph) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Graph) SummarizedDOTDescription ¶ added in v0.17.0
SummarizedDOTDescription returns a DOT representation of the graph. 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 (*Graph) TransposeWithDimensionsSource ¶ added in v0.17.0
func (g *Graph) TransposeWithDimensionsSource(dimensions []*foundation.Number, source *Tensor) *Tensor
TransposeWithDimensionsSource adds a new transpose layer to the graph using the dimensions and source tensor you specify.
type GraphCompilationOptions ¶ added in v0.17.0
type GraphCompilationOptions uint64
A bitmask that specifies the options you use when compiling a graph. Bitmask — values may be combined with |.
const ( // The default option for graph compilation. GraphCompilationOptionsNone GraphCompilationOptions = 0 // The option to debug layers during graph compilation. GraphCompilationOptionsDebugLayers GraphCompilationOptions = 1 // The option to disable layer fusion during graph compilation. GraphCompilationOptionsDisableLayerFusion GraphCompilationOptions = 2 // The option to link graphs during graph compilation. GraphCompilationOptionsLinkGraphs GraphCompilationOptions = 4 // The option to compute all gradients during graph compilation. GraphCompilationOptionsComputeAllGradients GraphCompilationOptions = 8 )
func (GraphCompilationOptions) String ¶ added in v0.17.0
func (e GraphCompilationOptions) String() string
String returns the GraphCompilationOptions constant's name, or its numeric form when the value is not a known constant.
type GraphProvider ¶ added in v0.17.0
GraphProvider is accepted wherever a MLCGraph (or one of its subclasses) is expected.
type GroupNormalizationLayer ¶ added in v0.17.0
type GroupNormalizationLayer struct {
Layer
}
GroupNormalizationLayer is an idiomatic wrapper over the Objective-C class MLCGroupNormalizationLayer.
It embeds Layer, promoting that type's methods.
A layer that divides the channels into groups for normalization.
func GroupNormalizationLayerFromID ¶ added in v0.17.0
func GroupNormalizationLayerFromID(id objc.ID) *GroupNormalizationLayer
GroupNormalizationLayerFromID adopts an existing Objective-C object as a GroupNormalizationLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithFeatureChannelCountGroupCountBetaGammaVarianceEpsilon ¶ added in v0.17.0
func LayerWithFeatureChannelCountGroupCountBetaGammaVarianceEpsilon(featureChannelCount int, groupCount int, beta *Tensor, gamma *Tensor, varianceEpsilon float32) *GroupNormalizationLayer
LayerWithFeatureChannelCountGroupCountBetaGammaVarianceEpsilon creates a group normalization layer with the number of feature channels and groups, beta and gamma tensors, and variance epsilon you specify.
func NewGroupNormalizationLayer ¶ added in v0.17.0
func NewGroupNormalizationLayer() *GroupNormalizationLayer
NewGroupNormalizationLayer creates a new GroupNormalizationLayer.
func (*GroupNormalizationLayer) Beta ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) Beta() *Tensor
Beta returns the beta tensor
func (*GroupNormalizationLayer) BetaParameter ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) BetaParameter() *TensorParameter
BetaParameter returns the beta tensor parameter used for optimizer update
func (*GroupNormalizationLayer) FeatureChannelCount ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) FeatureChannelCount() int
FeatureChannelCount returns the number of feature channels
func (*GroupNormalizationLayer) Gamma ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) Gamma() *Tensor
Gamma returns the gamma tensor
func (*GroupNormalizationLayer) GammaParameter ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) GammaParameter() *TensorParameter
GammaParameter returns the gamma tensor parameter used for optimizer update
func (*GroupNormalizationLayer) GroupCount ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) GroupCount() int
GroupCount returns the number of groups to separate the channels into
func (*GroupNormalizationLayer) VarianceEpsilon ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) VarianceEpsilon() float32
VarianceEpsilon returns a value used for numerical stability
func (*GroupNormalizationLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *GroupNormalizationLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*GroupNormalizationLayer) WithLabel ¶ added in v0.17.0
func (gnl *GroupNormalizationLayer) WithLabel(label string) *GroupNormalizationLayer
WithLabel sets a string that helps identify this layer.
type InferenceGraph ¶ added in v0.17.0
type InferenceGraph struct {
Graph
}
InferenceGraph is an idiomatic wrapper over the Objective-C class MLCInferenceGraph.
It embeds Graph, promoting that type's methods.
An inference graph created from one or more MLCGraph instances plus additional layers added directly to the inference graph.
func GraphWithGraphObjects ¶ added in v0.17.0
func GraphWithGraphObjects(graphObjects []*Graph) *InferenceGraph
GraphWithGraphObjects creates an inference graph with the layers from the graph objects you specify.
func InferenceGraphFromID ¶ added in v0.17.0
func InferenceGraphFromID(id objc.ID) *InferenceGraph
InferenceGraphFromID adopts an existing Objective-C object as a InferenceGraph (nil for 0), retaining it and registering a release finalizer.
func NewInferenceGraph ¶ added in v0.17.0
func NewInferenceGraph() *InferenceGraph
NewInferenceGraph creates a new InferenceGraph.
func (*InferenceGraph) AddInputs ¶ added in v0.17.0
func (ig *InferenceGraph) AddInputs(inputs map[string]*Tensor) bool
AddInputs adds the inputs you specify to the inference graph.
func (*InferenceGraph) AddInputsLossLabelsLossLabelWeights ¶ added in v0.17.0
func (ig *InferenceGraph) AddInputsLossLabelsLossLabelWeights(inputs map[string]*Tensor, lossLabels map[string]*Tensor, lossLabelWeights map[string]*Tensor) bool
AddInputsLossLabelsLossLabelWeights adds the inputs, loss labels, and loss label weights that you specify to the inference graph.
func (*InferenceGraph) AddOutputs ¶ added in v0.17.0
func (ig *InferenceGraph) AddOutputs(outputs map[string]*Tensor) bool
AddOutputs adds the outputs you specify to the inference graph.
func (*InferenceGraph) CompileWithOptionsDevice ¶ added in v0.17.0
func (ig *InferenceGraph) CompileWithOptionsDevice(options GraphCompilationOptions, device *Device) bool
CompileWithOptionsDevice compiles the inference graph for the options and device you specify.
func (*InferenceGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData ¶ added in v0.17.0
func (ig *InferenceGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options GraphCompilationOptions, device *Device, inputTensors map[string]*Tensor, inputTensorsData map[string]*TensorData) bool
CompileWithOptionsDeviceInputTensorsInputTensorsData compiles the inference graph for the options, device, and input tensors you specify.
func (*InferenceGraph) DeviceMemorySize ¶ added in v0.17.0
func (ig *InferenceGraph) DeviceMemorySize() int
DeviceMemorySize returns the total size in bytes of device memory used by all intermediate tensors in the inference graph
func (*InferenceGraph) ExecuteWithInputsDataBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (ig *InferenceGraph) ExecuteWithInputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteWithInputsDataBatchSizeOptionsCompletionHandler executes the inference graph with the inputs data, batch size, execution options, and completion handler you specify.
func (*InferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (ig *InferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, lossLabelWeightsData map[string]*TensorData, batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler executes the inference graph with the input data, batch size, execution options and completion handler you specify.
func (*InferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (ig *InferenceGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, lossLabelWeightsData map[string]*TensorData, outputsData map[string]*TensorData, batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler executes the inference graph with the input and output data, batch size, execution options, and completion handler that you specify.
func (*InferenceGraph) ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (ig *InferenceGraph) ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, outputsData map[string]*TensorData, batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteWithInputsDataOutputsDataBatchSizeOptionsCompletionHandler executes the inference graph with the inputs and outputs data, batch size, execution options, and completion handler that you specify.
func (*InferenceGraph) LinkWithGraphs ¶ added in v0.17.0
func (ig *InferenceGraph) LinkWithGraphs(graphs []*InferenceGraph) bool
LinkWithGraphs links the inference graphs you specify.
type InstanceNormalizationLayer ¶ added in v0.17.0
type InstanceNormalizationLayer struct {
Layer
}
InstanceNormalizationLayer is an idiomatic wrapper over the Objective-C class MLCInstanceNormalizationLayer.
It embeds Layer, promoting that type's methods.
A layer that normalizes all features of one channel.
func InstanceNormalizationLayerFromID ¶ added in v0.17.0
func InstanceNormalizationLayerFromID(id objc.ID) *InstanceNormalizationLayer
InstanceNormalizationLayerFromID adopts an existing Objective-C object as a InstanceNormalizationLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithFeatureChannelCountBetaGammaVarianceEpsilon ¶ added in v0.17.0
func LayerWithFeatureChannelCountBetaGammaVarianceEpsilon(featureChannelCount int, beta *Tensor, gamma *Tensor, varianceEpsilon float32) *InstanceNormalizationLayer
LayerWithFeatureChannelCountBetaGammaVarianceEpsilon creates an instance normalization layer with the number of feature channels, beta and gamma tensors, and variance epsilon you specify.
func LayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum ¶ added in v0.17.0
func LayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum(featureChannelCount int, beta *Tensor, gamma *Tensor, varianceEpsilon float32, momentum float32) *InstanceNormalizationLayer
LayerWithFeatureChannelCountBetaGammaVarianceEpsilonMomentum 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 int, mean *Tensor, variance *Tensor, beta *Tensor, gamma *Tensor, varianceEpsilon float32, momentum float32) *InstanceNormalizationLayer
MLCInstanceNormalizationLayerLayerWithFeatureChannelCountMeanVarianceBetaGammaVarianceEpsilonMomentum creates an instance normalization layer with the number of feature channels, mean, variance, beta and gamma tensors, variance epsilon, and momentum you specify.
func NewInstanceNormalizationLayer ¶ added in v0.17.0
func NewInstanceNormalizationLayer() *InstanceNormalizationLayer
NewInstanceNormalizationLayer creates a new InstanceNormalizationLayer.
func (*InstanceNormalizationLayer) Beta ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) Beta() *Tensor
Beta returns the beta tensor
func (*InstanceNormalizationLayer) BetaParameter ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) BetaParameter() *TensorParameter
BetaParameter returns the beta tensor parameter used for optimizer update
func (*InstanceNormalizationLayer) FeatureChannelCount ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) FeatureChannelCount() int
FeatureChannelCount returns the number of feature channels
func (*InstanceNormalizationLayer) Gamma ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) Gamma() *Tensor
Gamma returns the gamma tensor
func (*InstanceNormalizationLayer) GammaParameter ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) GammaParameter() *TensorParameter
GammaParameter returns the gamma tensor parameter used for optimizer update
func (*InstanceNormalizationLayer) Mean ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) Mean() *Tensor
Mean returns the running mean tensor
func (*InstanceNormalizationLayer) Momentum ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) Momentum() float32
Momentum returns the value used for the running mean and variance computation The default is 0.99f.
func (*InstanceNormalizationLayer) Variance ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) Variance() *Tensor
Variance returns the running variance tensor
func (*InstanceNormalizationLayer) VarianceEpsilon ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) VarianceEpsilon() float32
VarianceEpsilon returns a value used for numerical stability
func (*InstanceNormalizationLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *InstanceNormalizationLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*InstanceNormalizationLayer) WithLabel ¶ added in v0.17.0
func (inl *InstanceNormalizationLayer) WithLabel(label string) *InstanceNormalizationLayer
WithLabel sets a string that helps identify this layer.
type IpcInfoObjectType ¶ added in v0.17.0
type IpcInfoObjectType uint32
const ( IpcInfoObjectTypeNone IpcInfoObjectType = 0 IpcInfoObjectTypeThreadControl IpcInfoObjectType = 1 IpcInfoObjectTypeTaskControl IpcInfoObjectType = 2 IpcInfoObjectTypeHost IpcInfoObjectType = 3 IpcInfoObjectTypeHostPriv IpcInfoObjectType = 4 IpcInfoObjectTypeProcessor IpcInfoObjectType = 5 IpcInfoObjectTypeProcessorSet IpcInfoObjectType = 6 IpcInfoObjectTypeProcessorSetName IpcInfoObjectType = 7 IpcInfoObjectTypeTimer IpcInfoObjectType = 8 IpcInfoObjectTypePortSubstOnce IpcInfoObjectType = 9 IpcInfoObjectTypeMig IpcInfoObjectType = 10 IpcInfoObjectTypeMemoryObject IpcInfoObjectType = 11 IpcInfoObjectTypeXmmPager IpcInfoObjectType = 12 IpcInfoObjectTypeXmmKernel IpcInfoObjectType = 13 IpcInfoObjectTypeXmmReply IpcInfoObjectType = 14 IpcInfoObjectTypeUndReply IpcInfoObjectType = 15 IpcInfoObjectTypeHostNotify IpcInfoObjectType = 16 IpcInfoObjectTypeHostSecurity IpcInfoObjectType = 17 IpcInfoObjectTypeLedger IpcInfoObjectType = 18 IpcInfoObjectTypeMainDevice IpcInfoObjectType = 19 IpcInfoObjectTypeTaskName IpcInfoObjectType = 20 IpcInfoObjectTypeSubsystem IpcInfoObjectType = 21 IpcInfoObjectTypeIODoneQueue IpcInfoObjectType = 22 IpcInfoObjectTypeSemaphore IpcInfoObjectType = 23 IpcInfoObjectTypeLockSet IpcInfoObjectType = 24 IpcInfoObjectTypeClock IpcInfoObjectType = 25 IpcInfoObjectTypeClockCtrl IpcInfoObjectType = 26 IpcInfoObjectTypeIokitIdent IpcInfoObjectType = 27 IpcInfoObjectTypeNamedEntry IpcInfoObjectType = 28 IpcInfoObjectTypeIokitConnect IpcInfoObjectType = 29 IpcInfoObjectTypeIokitObject IpcInfoObjectType = 30 IpcInfoObjectTypeUpl IpcInfoObjectType = 31 IpcInfoObjectTypeMemObjControl IpcInfoObjectType = 32 IpcInfoObjectTypeAuSessionport IpcInfoObjectType = 33 IpcInfoObjectTypeFileport IpcInfoObjectType = 34 IpcInfoObjectTypeLabelh IpcInfoObjectType = 35 IpcInfoObjectTypeTaskResume IpcInfoObjectType = 36 IpcInfoObjectTypeVoucher IpcInfoObjectType = 37 IpcInfoObjectTypeVoucherAttrControl IpcInfoObjectType = 38 IpcInfoObjectTypeWorkInterval IpcInfoObjectType = 39 IpcInfoObjectTypeUxHandler IpcInfoObjectType = 40 IpcInfoObjectTypeUextObject IpcInfoObjectType = 41 IpcInfoObjectTypeArcadeReg IpcInfoObjectType = 42 IpcInfoObjectTypeEventlink IpcInfoObjectType = 43 IpcInfoObjectTypeTaskInspect IpcInfoObjectType = 44 IpcInfoObjectTypeTaskRead IpcInfoObjectType = 45 IpcInfoObjectTypeThreadInspect IpcInfoObjectType = 46 IpcInfoObjectTypeThreadRead IpcInfoObjectType = 47 IpcInfoObjectTypeSuidCred IpcInfoObjectType = 48 IpcInfoObjectTypeHypervisor IpcInfoObjectType = 49 IpcInfoObjectTypeTaskIDToken IpcInfoObjectType = 50 IpcInfoObjectTypeTaskFatal IpcInfoObjectType = 51 IpcInfoObjectTypeKcdata IpcInfoObjectType = 52 IpcInfoObjectTypeExclavesResource IpcInfoObjectType = 53 IpcInfoObjectTypeThreadResume IpcInfoObjectType = 54 IpcInfoObjectTypeUnknown IpcInfoObjectType = 4294967295 )
func (IpcInfoObjectType) String ¶ added in v0.17.0
func (e IpcInfoObjectType) String() string
String returns the IpcInfoObjectType constant's name, or its numeric form when the value is not a known constant.
type LSTMDescriptor ¶ added in v0.17.0
LSTMDescriptor is an idiomatic wrapper over the Objective-C class MLCLSTMDescriptor.
The configuration object you use to create the LSTM layer.
func DescriptorWithInputSizeHiddenSizeLayerCount ¶ added in v0.17.0
func DescriptorWithInputSizeHiddenSizeLayerCount(inputSize int, hiddenSize int, layerCount int) *LSTMDescriptor
DescriptorWithInputSizeHiddenSizeLayerCount creates a batch first LSTM descriptor with the input size and number of layers you specify.
func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout ¶ added in v0.17.0
func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout(inputSize int, hiddenSize int, layerCount int, usesBiases bool, batchFirst bool, isBidirectional bool, dropout float32) *LSTMDescriptor
DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalDropout creates a batch first LSTM descriptor that allows you to indicate whether the input and output shape is batch first.
func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout ¶ added in v0.17.0
func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout(inputSize int, hiddenSize int, layerCount int, usesBiases bool, batchFirst bool, isBidirectional bool, returnsSequences bool, dropout float32) *LSTMDescriptor
DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropout 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 DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode ¶ added in v0.17.0
func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode(inputSize int, hiddenSize int, layerCount int, usesBiases bool, batchFirst bool, isBidirectional bool, returnsSequences bool, dropout float32, resultMode LSTMResultMode) *LSTMDescriptor
DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesBatchFirstIsBidirectionalReturnsSequencesDropoutResultMode 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 DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout ¶ added in v0.17.0
func DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout(inputSize int, hiddenSize int, layerCount int, usesBiases bool, isBidirectional bool, dropout float32) *LSTMDescriptor
DescriptorWithInputSizeHiddenSizeLayerCountUsesBiasesIsBidirectionalDropout creates a batch first LSTM descriptor with bias and bidirectional options you specify.
func LSTMDescriptorFromID ¶ added in v0.17.0
func LSTMDescriptorFromID(id objc.ID) *LSTMDescriptor
LSTMDescriptorFromID adopts an existing Objective-C object as a LSTMDescriptor (nil for 0), retaining it and registering a release finalizer.
func NewLSTMDescriptor ¶ added in v0.17.0
func NewLSTMDescriptor() *LSTMDescriptor
NewLSTMDescriptor creates a new LSTMDescriptor.
func (*LSTMDescriptor) BatchFirst ¶ added in v0.17.0
func (ld *LSTMDescriptor) BatchFirst() bool
BatchFirst reports whether LSTM only supports batchFirst=YES. This means the input and output will have shape [batch size, time steps, feature]. Default is true.
func (*LSTMDescriptor) Description ¶ added in v0.17.0
func (ld *LSTMDescriptor) Description() string
Description returns the object's -description text.
func (*LSTMDescriptor) Dropout ¶ added in v0.17.0
func (ld *LSTMDescriptor) Dropout() float32
Dropout returns 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 (*LSTMDescriptor) HiddenSize ¶ added in v0.17.0
func (ld *LSTMDescriptor) HiddenSize() int
HiddenSize returns the number of feature channels in the hidden state
func (*LSTMDescriptor) InputSize ¶ added in v0.17.0
func (ld *LSTMDescriptor) InputSize() int
InputSize returns the number of expected feature channels in the input
func (*LSTMDescriptor) IsBidirectional ¶ added in v0.17.0
func (ld *LSTMDescriptor) IsBidirectional() bool
IsBidirectional reports whether if true, becomes a bidirectional LSTM. Default is false.
func (*LSTMDescriptor) IsEqual ¶ added in v0.17.0
func (ld *LSTMDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*LSTMDescriptor) IsKind ¶ added in v0.17.0
func (ld *LSTMDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*LSTMDescriptor) LayerCount ¶ added in v0.17.0
func (ld *LSTMDescriptor) LayerCount() int
LayerCount returns the number of recurrent layers. Default is 1.
func (*LSTMDescriptor) ResultMode ¶ added in v0.17.0
func (ld *LSTMDescriptor) ResultMode() LSTMResultMode
ResultMode returns MLCLSTMResultModeOutput returns output data. MLCLSTMResultModeOutputAndStates returns output data, last hidden state h_n, and last cell state c_n. Default MLCLSTMResultModeOutput.
func (*LSTMDescriptor) ReturnsSequences ¶ added in v0.17.0
func (ld *LSTMDescriptor) ReturnsSequences() bool
ReturnsSequences reports whether if true return output for all sequences else return output only for the last sequences. Default: true
func (*LSTMDescriptor) String ¶ added in v0.17.0
func (ld *LSTMDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*LSTMDescriptor) UsesBiases ¶ added in v0.17.0
func (ld *LSTMDescriptor) UsesBiases() bool
UsesBiases reports whether if false, the layer does not use bias terms. Default is true.
type LSTMLayer ¶ added in v0.17.0
type LSTMLayer struct {
Layer
}
LSTMLayer is an idiomatic wrapper over the Objective-C class MLCLSTMLayer.
It embeds Layer, promoting that type's methods.
A layer that represents long short-term memory (LSTM) networks.
func LSTMLayerFromID ¶ added in v0.17.0
LSTMLayerFromID adopts an existing Objective-C object as a LSTMLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithDescriptorInputWeightsHiddenWeightsBiases ¶ added in v0.17.0
func LayerWithDescriptorInputWeightsHiddenWeightsBiases(descriptor *LSTMDescriptor, inputWeights []*Tensor, hiddenWeights []*Tensor, biases []*Tensor) *LSTMLayer
LayerWithDescriptorInputWeightsHiddenWeightsBiases creates an LSTM layer with the descriptor, input and hidden weights, and biases you specify.
func LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases ¶ added in v0.17.0
func LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases(descriptor *LSTMDescriptor, inputWeights []*Tensor, hiddenWeights []*Tensor, peepholeWeights []*Tensor, biases []*Tensor) *LSTMLayer
LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiases creates an LSTM layer with the descriptor, weights, and biases you specify.
func LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation ¶ added in v0.17.0
func LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation(descriptor *LSTMDescriptor, inputWeights []*Tensor, hiddenWeights []*Tensor, peepholeWeights []*Tensor, biases []*Tensor, gateActivations []*ActivationDescriptor, outputResultActivation *ActivationDescriptor) *LSTMLayer
LayerWithDescriptorInputWeightsHiddenWeightsPeepholeWeightsBiasesGateActivationsOutputResultActivation creates an LSTM layer using the descriptor, weights, biases, gate activations, and output result activation that you specify.
func NewLSTMLayer ¶ added in v0.17.0
func NewLSTMLayer() *LSTMLayer
NewLSTMLayer creates a new LSTMLayer.
func (*LSTMLayer) Biases ¶ added in v0.17.0
Biases returns the array of tensors describing the bias terms for the input, hidden, cell and output gates
Biases returns the collection as a Go slice.
func (*LSTMLayer) BiasesParameters ¶ added in v0.17.0
func (ll *LSTMLayer) BiasesParameters() []*TensorParameter
BiasesParameters returns the bias tensor parameter used for optimizer update
BiasesParameters returns the collection as a Go slice.
func (*LSTMLayer) Descriptor ¶ added in v0.17.0
func (ll *LSTMLayer) Descriptor() *LSTMDescriptor
Descriptor returns the LSTM descriptor
func (*LSTMLayer) GateActivations ¶ added in v0.17.0
func (ll *LSTMLayer) GateActivations() []*ActivationDescriptor
GateActivations returns the array of gate activations for input, hidden, cell and output gates The default gate activations are: sigmoid, sigmoid, tanh, sigmoid
GateActivations returns the collection as a Go slice.
func (*LSTMLayer) HiddenWeights ¶ added in v0.17.0
HiddenWeights returns the array of tensors describing the hidden weights for the input, hidden, cell and output gates
HiddenWeights returns the collection as a Go slice.
func (*LSTMLayer) HiddenWeightsParameters ¶ added in v0.17.0
func (ll *LSTMLayer) HiddenWeightsParameters() []*TensorParameter
HiddenWeightsParameters returns the hidden weights tensor parameters used for optimizer update
HiddenWeightsParameters returns the collection as a Go slice.
func (*LSTMLayer) InputWeights ¶ added in v0.17.0
InputWeights returns the array of tensors describing the input weights for the input, hidden, cell and output gates
InputWeights returns the collection as a Go slice.
func (*LSTMLayer) InputWeightsParameters ¶ added in v0.17.0
func (ll *LSTMLayer) InputWeightsParameters() []*TensorParameter
InputWeightsParameters returns the input weights tensor parameters used for optimizer update
InputWeightsParameters returns the collection as a Go slice.
func (*LSTMLayer) OutputResultActivation ¶ added in v0.17.0
func (ll *LSTMLayer) OutputResultActivation() *ActivationDescriptor
OutputResultActivation returns the output activation descriptor
func (*LSTMLayer) PeepholeWeights ¶ added in v0.17.0
PeepholeWeights returns the array of tensors describing the peephole weights for the input, hidden, cell and output gates
PeepholeWeights returns the collection as a Go slice.
func (*LSTMLayer) PeepholeWeightsParameters ¶ added in v0.17.0
func (ll *LSTMLayer) PeepholeWeightsParameters() []*TensorParameter
PeepholeWeightsParameters returns the peephole weights tensor parameters used for optimizer update
PeepholeWeightsParameters returns the collection as a Go slice.
func (*LSTMLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
type LSTMResultMode ¶ added in v0.17.0
type LSTMResultMode uint64
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. LSTMResultModeOutput LSTMResultMode = 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. LSTMResultModeOutputAndStates LSTMResultMode = 1 )
func (LSTMResultMode) String ¶ added in v0.17.0
func (e LSTMResultMode) String() string
String returns the LSTMResultMode constant's name, or its numeric form when the value is not a known constant.
type LaunchDataType ¶ added in v0.17.0
type LaunchDataType int32
const ( LaunchDataTypeDictionary LaunchDataType = 1 LaunchDataTypeArray LaunchDataType = 2 LaunchDataTypeFd LaunchDataType = 3 LaunchDataTypeInteger LaunchDataType = 4 LaunchDataTypeReal LaunchDataType = 5 LaunchDataTypeBool LaunchDataType = 6 LaunchDataTypeString LaunchDataType = 7 LaunchDataTypeOpaque LaunchDataType = 8 LaunchDataTypeErrno LaunchDataType = 9 LaunchDataTypeMachport LaunchDataType = 10 )
func (LaunchDataType) String ¶ added in v0.17.0
func (e LaunchDataType) String() string
String returns the LaunchDataType constant's name, or its numeric form when the value is not a known constant.
type Layer ¶ added in v0.17.0
Layer is an idiomatic wrapper over the Objective-C class MLCLayer.
Layer is an abstract base — you do not construct it directly. Construct one of ActivationLayer, ArithmeticLayer, BatchNormalizationLayer, ComparisonLayer, ConcatenationLayer, ConvolutionLayer, DropoutLayer, EmbeddingLayer, FullyConnectedLayer, GatherLayer, GramMatrixLayer, GroupNormalizationLayer, InstanceNormalizationLayer, LSTMLayer, LayerNormalizationLayer, LossLayer, MatMulLayer, MultiheadAttentionLayer, PaddingLayer, PoolingLayer, ReductionLayer, ReshapeLayer, ScatterLayer, SelectionLayer, SliceLayer, SoftmaxLayer, SplitLayer, TransposeLayer, UpsampleLayer and pass it where a Layer is accepted.
The base class for all framework layers.
func LayerFromID ¶ added in v0.17.0
LayerFromID adopts an existing Objective-C object as a Layer (nil for 0), retaining it and registering a release finalizer.
func (*Layer) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Layer) DeviceType ¶ added in v0.17.0
func (l *Layer) DeviceType() DeviceType
DeviceType returns the device type where this layer will be executed 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 (*Layer) IsDebuggingEnabled ¶ added in v0.17.0
IsDebuggingEnabled reports whether a flag to identify if we want to debug this layer when executing a graph that includes this layer If this is set, we will make sure that the result tensor and gradient tensors are available for reading on CPU The default is false. If isDebuggingEnabled is set to true, make sure to set options to enable debugging when compiling the graph. Otherwise this property may be ignored.
func (*Layer) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Layer) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Layer) LayerID ¶ added in v0.17.0
LayerID returns the layer ID A unique number to identify each layer. Assigned when the layer is created.
func (*Layer) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Layer) WithIsDebuggingEnabled ¶ added in v0.17.0
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
type LayerNormalizationLayer ¶ added in v0.17.0
type LayerNormalizationLayer struct {
Layer
}
LayerNormalizationLayer is an idiomatic wrapper over the Objective-C class MLCLayerNormalizationLayer.
It embeds Layer, promoting that type's methods.
A layer that applies layer normalization over inputs.
func LayerNormalizationLayerFromID ¶ added in v0.17.0
func LayerNormalizationLayerFromID(id objc.ID) *LayerNormalizationLayer
LayerNormalizationLayerFromID adopts an existing Objective-C object as a LayerNormalizationLayer (nil for 0), retaining it and registering a release finalizer.
func LayerWithNormalizedShapeBetaGammaVarianceEpsilon ¶ added in v0.17.0
func LayerWithNormalizedShapeBetaGammaVarianceEpsilon(normalizedShape []*foundation.Number, beta *Tensor, gamma *Tensor, varianceEpsilon float32) *LayerNormalizationLayer
LayerWithNormalizedShapeBetaGammaVarianceEpsilon creates a normalization layer with a shape, beta and gamma tensors, and variance epsilon you specify.
func NewLayerNormalizationLayer ¶ added in v0.17.0
func NewLayerNormalizationLayer() *LayerNormalizationLayer
NewLayerNormalizationLayer creates a new LayerNormalizationLayer.
func (*LayerNormalizationLayer) Beta ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) Beta() *Tensor
Beta returns the beta tensor
func (*LayerNormalizationLayer) BetaParameter ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) BetaParameter() *TensorParameter
BetaParameter returns the beta tensor parameter used for optimizer update
func (*LayerNormalizationLayer) Gamma ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) Gamma() *Tensor
Gamma returns the gamma tensor
func (*LayerNormalizationLayer) GammaParameter ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) GammaParameter() *TensorParameter
GammaParameter returns the gamma tensor parameter used for optimizer update
func (*LayerNormalizationLayer) NormalizedShape ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) NormalizedShape() []obj.Object
NormalizedShape returns the shape of the axes over which normalization occurs, (W), (H,W) or (C,H,W)
NormalizedShape returns the collection as a Go slice.
func (*LayerNormalizationLayer) VarianceEpsilon ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) VarianceEpsilon() float32
VarianceEpsilon returns a value used for numerical stability
func (*LayerNormalizationLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *LayerNormalizationLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*LayerNormalizationLayer) WithLabel ¶ added in v0.17.0
func (lnl *LayerNormalizationLayer) WithLabel(label string) *LayerNormalizationLayer
WithLabel sets a string that helps identify this layer.
type LayerProvider ¶ added in v0.17.0
LayerProvider is accepted wherever a MLCLayer (or one of its subclasses) is expected.
type LossDescriptor ¶ added in v0.17.0
LossDescriptor is an idiomatic wrapper over the Objective-C class MLCLossDescriptor.
A configuration object you use to create a loss layer.
func DescriptorWithTypeReductionType ¶ added in v0.17.0
func DescriptorWithTypeReductionType(lossType LossType, reductionType ReductionType) *LossDescriptor
DescriptorWithTypeReductionType creates a loss descriptor with the loss function and reduction type you specify.
func DescriptorWithTypeReductionTypeWeight ¶ added in v0.17.0
func DescriptorWithTypeReductionTypeWeight(lossType LossType, reductionType ReductionType, weight float32) *LossDescriptor
DescriptorWithTypeReductionTypeWeight creates a loss descriptor with the loss function, reduction type, and weight you specify.
func DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount ¶ added in v0.17.0
func DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount(lossType LossType, reductionType ReductionType, weight float32, labelSmoothing float32, classCount int) *LossDescriptor
DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCount creates a loss descriptor with the loss function, reduction type, weight, label smoothing, and number of classes you specify.
func DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta ¶ added in v0.17.0
func DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta(lossType LossType, reductionType ReductionType, weight float32, labelSmoothing float32, classCount int, epsilon float32, delta float32) *LossDescriptor
DescriptorWithTypeReductionTypeWeightLabelSmoothingClassCountEpsilonDelta creates a loss descriptor with the loss function, reduction type, weight, label smoothing, and number of classes, epsilon, and delta that you specify.
func LossDescriptorFromID ¶ added in v0.17.0
func LossDescriptorFromID(id objc.ID) *LossDescriptor
LossDescriptorFromID adopts an existing Objective-C object as a LossDescriptor (nil for 0), retaining it and registering a release finalizer.
func NewLossDescriptor ¶ added in v0.17.0
func NewLossDescriptor() *LossDescriptor
NewLossDescriptor creates a new LossDescriptor.
func (*LossDescriptor) ClassCount ¶ added in v0.17.0
func (ld *LossDescriptor) ClassCount() int
ClassCount returns the number of classes parameter. The default value is 1. This parameter is valid only for the loss function MLCLossTypeSoftmaxCrossEntropy.
func (*LossDescriptor) Delta ¶ added in v0.17.0
func (ld *LossDescriptor) Delta() float32
Delta returns the delta parameter. The default value is 1.0f. This parameter is valid only for the loss function MLCLossTypeHuber.
func (*LossDescriptor) Description ¶ added in v0.17.0
func (ld *LossDescriptor) Description() string
Description returns the object's -description text.
func (*LossDescriptor) Epsilon ¶ added in v0.17.0
func (ld *LossDescriptor) Epsilon() float32
Epsilon returns the epsilon parameter. The default value is 1e-7. This parameter is valid only for the loss function MLCLossTypeLog.
func (*LossDescriptor) IsEqual ¶ added in v0.17.0
func (ld *LossDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*LossDescriptor) IsKind ¶ added in v0.17.0
func (ld *LossDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*LossDescriptor) LabelSmoothing ¶ added in v0.17.0
func (ld *LossDescriptor) LabelSmoothing() float32
LabelSmoothing returns the label smoothing parameter. The default value is 0.0. This parameter is valid only for the loss functions of the following type(s): MLCLossTypeSoftmaxCrossEntropy and MLCLossTypeSigmoidCrossEntropy.
func (*LossDescriptor) LossType ¶ added in v0.17.0
func (ld *LossDescriptor) LossType() LossType
LossType specifies the loss function.
func (*LossDescriptor) ReductionType ¶ added in v0.17.0
func (ld *LossDescriptor) ReductionType() ReductionType
ReductionType returns the reduction operation performed by the loss function.
func (*LossDescriptor) String ¶ added in v0.17.0
func (ld *LossDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*LossDescriptor) Weight ¶ added in v0.17.0
func (ld *LossDescriptor) Weight() float32
Weight returns the scale factor to apply to each element of a result. The default value is 1.0.
type LossLayer ¶ added in v0.17.0
type LossLayer struct {
Layer
}
LossLayer is an idiomatic wrapper over the Objective-C class MLCLossLayer.
LossLayer is an abstract base — you do not construct it directly. Construct one of YOLOLossLayer and pass it where a LossLayer is accepted.
A layer that estimates the inaccuracies of the model to reduce the loss on the next evaluation.
func CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight ¶ added in v0.17.0
func CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType ReductionType, labelSmoothing float32, classCount int, weight float32) *LossLayer
CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight creates a categorical cross entropy loss layer with the reduction type, label smoothing, number of classes, and weight you specify.
func CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights ¶ added in v0.17.0
func CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType ReductionType, labelSmoothing float32, classCount int, weights *Tensor) *LossLayer
CategoricalCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights creates a categorical cross entropy loss layer with the reduction type, label smoothing, number of classes, and weights you specify.
func CosineDistanceLossWithReductionTypeWeight ¶ added in v0.17.0
func CosineDistanceLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
CosineDistanceLossWithReductionTypeWeight creates a cosine distance loss layer with the reduction type and weight you specify.
func CosineDistanceLossWithReductionTypeWeights ¶ added in v0.17.0
func CosineDistanceLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
CosineDistanceLossWithReductionTypeWeights creates a cosine distance loss layer with the reduction type and weights you specify.
func HingeLossWithReductionTypeWeight ¶ added in v0.17.0
func HingeLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
HingeLossWithReductionTypeWeight creates a hinge loss layer with the reduction type and weight you specify.
func HingeLossWithReductionTypeWeights ¶ added in v0.17.0
func HingeLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
HingeLossWithReductionTypeWeights creates a hinge loss layer with the reduction type and weights you specify.
func HuberLossWithReductionTypeDeltaWeight ¶ added in v0.17.0
func HuberLossWithReductionTypeDeltaWeight(reductionType ReductionType, delta float32, weight float32) *LossLayer
HuberLossWithReductionTypeDeltaWeight creates a huber loss layer with the reduction type, delta, and weight you specify.
func HuberLossWithReductionTypeDeltaWeights ¶ added in v0.17.0
func HuberLossWithReductionTypeDeltaWeights(reductionType ReductionType, delta float32, weights *Tensor) *LossLayer
HuberLossWithReductionTypeDeltaWeights creates a huber loss layer with the reduction type, delta, and weights you specify.
func LogLossWithReductionTypeEpsilonWeight ¶ added in v0.17.0
func LogLossWithReductionTypeEpsilonWeight(reductionType ReductionType, epsilon float32, weight float32) *LossLayer
LogLossWithReductionTypeEpsilonWeight creates a log loss layer with the reduction type, epsilon, and weight you specify.
func LogLossWithReductionTypeEpsilonWeights ¶ added in v0.17.0
func LogLossWithReductionTypeEpsilonWeights(reductionType ReductionType, epsilon float32, weights *Tensor) *LossLayer
LogLossWithReductionTypeEpsilonWeights creates a log loss layer with the reduction type, epsilon, and weights you specify.
func LossLayerFromID ¶ added in v0.17.0
LossLayerFromID adopts an existing Objective-C object as a LossLayer (nil for 0), retaining it and registering a release finalizer.
func MLCLossLayerLayerWithDescriptor ¶
func MLCLossLayerLayerWithDescriptor(lossDescriptor *LossDescriptor) *LossLayer
MLCLossLayerLayerWithDescriptor creates a loss layer with the descriptor you specify.
func MLCLossLayerLayerWithDescriptorWeights ¶
func MLCLossLayerLayerWithDescriptorWeights(lossDescriptor *LossDescriptor, weights *Tensor) *LossLayer
MLCLossLayerLayerWithDescriptorWeights creates a loss layer with the descriptor and weights you specify.
func MeanAbsoluteErrorLossWithReductionTypeWeight ¶ added in v0.17.0
func MeanAbsoluteErrorLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
MeanAbsoluteErrorLossWithReductionTypeWeight creates a mean absolute loss layer with the reduction type and weight.
func MeanAbsoluteErrorLossWithReductionTypeWeights ¶ added in v0.17.0
func MeanAbsoluteErrorLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
MeanAbsoluteErrorLossWithReductionTypeWeights creates a mean absolute loss layer with the reduction type and weights you specify.
func MeanSquaredErrorLossWithReductionTypeWeight ¶ added in v0.17.0
func MeanSquaredErrorLossWithReductionTypeWeight(reductionType ReductionType, weight float32) *LossLayer
MeanSquaredErrorLossWithReductionTypeWeight creates a mean squared loss layer with the reduction type and weight you specify.
func MeanSquaredErrorLossWithReductionTypeWeights ¶ added in v0.17.0
func MeanSquaredErrorLossWithReductionTypeWeights(reductionType ReductionType, weights *Tensor) *LossLayer
MeanSquaredErrorLossWithReductionTypeWeights creates a mean squared loss layer with the reduction type and weights you specify.
func SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight ¶ added in v0.17.0
func SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight(reductionType ReductionType, labelSmoothing float32, weight float32) *LossLayer
SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeight creates a sigmoid cross entropy loss layer with the reduction type, label smoothing, and weight you specify.
func SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights ¶ added in v0.17.0
func SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights(reductionType ReductionType, labelSmoothing float32, weights *Tensor) *LossLayer
SigmoidCrossEntropyLossWithReductionTypeLabelSmoothingWeights creates a sigmoid cross entropy loss layer with the reduction type, label smoothing, and weights you specify.
func SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight ¶ added in v0.17.0
func SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight(reductionType ReductionType, labelSmoothing float32, classCount int, weight float32) *LossLayer
SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeight creates a softmax cross entropy loss layer with the reduction type, label smoothing, number of classes, and weight you specify.
func SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights ¶ added in v0.17.0
func SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights(reductionType ReductionType, labelSmoothing float32, classCount int, weights *Tensor) *LossLayer
SoftmaxCrossEntropyLossWithReductionTypeLabelSmoothingClassCountWeights creates a softmax cross entropy loss layer with the reduction type, label smoothing, number of classes, and weights you specify.
func (*LossLayer) Descriptor ¶ added in v0.17.0
func (ll *LossLayer) Descriptor() *LossDescriptor
Descriptor returns the loss descriptor
func (*LossLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
type LossLayerProvider ¶ added in v0.17.0
LossLayerProvider is accepted wherever a MLCLossLayer (or one of its subclasses) is expected.
type LossType ¶ added in v0.17.0
type LossType int32
A loss function.
const ( // The mean absolute error loss. LossTypeMeanAbsoluteError LossType = 0 // The mean squared error loss. LossTypeMeanSquaredError LossType = 1 // The softmax cross entropy loss. LossTypeSoftmaxCrossEntropy LossType = 2 // The sigmoid cross entropy loss. LossTypeSigmoidCrossEntropy LossType = 3 // The categorical cross entropy loss. LossTypeCategoricalCrossEntropy LossType = 4 // The hinge loss. LossTypeHinge LossType = 5 // The Huber loss. LossTypeHuber LossType = 6 // The cosine distance loss. LossTypeCosineDistance LossType = 7 // The log loss. LossTypeLog LossType = 8 LossTypeCount LossType = 9 )
type MDLabelDomain ¶
type MDLabelDomain int32
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
String returns the MDLabelDomain constant's name, or its numeric form when the value is not a known constant.
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int32
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
String returns the MDQueryOptionFlags constant's name, or its numeric form when the value is not a known constant.
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int32
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
String returns the MDQuerySortOptionFlags constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeFlags ¶ added in v0.17.0
type MachVMRangeFlags uint64
Bitmask — values may be combined with |.
const (
MachVMRangeFlagsNone MachVMRangeFlags = 0
)
func (MachVMRangeFlags) String ¶ added in v0.17.0
func (e MachVMRangeFlags) String() string
String returns the MachVMRangeFlags constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeFlavor ¶ added in v0.17.0
type MachVMRangeFlavor uint32
const ( MachVMRangeFlavorInvalid MachVMRangeFlavor = 0 MachVMRangeFlavorV1 MachVMRangeFlavor = 1 )
func (MachVMRangeFlavor) String ¶ added in v0.17.0
func (e MachVMRangeFlavor) String() string
String returns the MachVMRangeFlavor constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeTag ¶ added in v0.17.0
type MachVMRangeTag uint16
const ( MachVMRangeTagDefault MachVMRangeTag = 0 MachVMRangeTagData MachVMRangeTag = 1 MachVMRangeTagFixed MachVMRangeTag = 2 )
func (MachVMRangeTag) String ¶ added in v0.17.0
func (e MachVMRangeTag) String() string
String returns the MachVMRangeTag constant's name, or its numeric form when the value is not a known constant.
type MatMulDescriptor ¶ added in v0.17.0
MatMulDescriptor is an idiomatic wrapper over the Objective-C class MLCMatMulDescriptor.
A configuration object you use to create a matrix multiplication layer.
func Descriptor ¶ added in v0.17.0
func Descriptor() *MatMulDescriptor
Descriptor creates a batched matrix multiplication descriptor.
func DescriptorWithAlphaTransposesXTransposesY ¶ added in v0.17.0
func DescriptorWithAlphaTransposesXTransposesY(alpha float32, transposesX bool, transposesY bool) *MatMulDescriptor
DescriptorWithAlphaTransposesXTransposesY creates a batched matrix multiplication descriptor with the alpha value and transpose options you specify.
func MatMulDescriptorFromID ¶ added in v0.17.0
func MatMulDescriptorFromID(id objc.ID) *MatMulDescriptor
MatMulDescriptorFromID adopts an existing Objective-C object as a MatMulDescriptor (nil for 0), retaining it and registering a release finalizer.
func NewMatMulDescriptor ¶ added in v0.17.0
func NewMatMulDescriptor() *MatMulDescriptor
NewMatMulDescriptor creates a new MatMulDescriptor.
func (*MatMulDescriptor) Alpha ¶ added in v0.17.0
func (mmd *MatMulDescriptor) Alpha() float32
Alpha returns a scalar to scale the result in C=alpha x X x Y. Default = 1.0
func (*MatMulDescriptor) Description ¶ added in v0.17.0
func (mmd *MatMulDescriptor) Description() string
Description returns the object's -description text.
func (*MatMulDescriptor) IsEqual ¶ added in v0.17.0
func (mmd *MatMulDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*MatMulDescriptor) IsKind ¶ added in v0.17.0
func (mmd *MatMulDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*MatMulDescriptor) String ¶ added in v0.17.0
func (mmd *MatMulDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*MatMulDescriptor) TransposesX ¶ added in v0.17.0
func (mmd *MatMulDescriptor) TransposesX() bool
TransposesX reports whether if true, transposes the last two dimensions of X. Default = False
func (*MatMulDescriptor) TransposesY ¶ added in v0.17.0
func (mmd *MatMulDescriptor) TransposesY() bool
TransposesY reports whether if true, transposes the last two dimensions of Y. Default = False
type MatMulLayer ¶ added in v0.17.0
type MatMulLayer struct {
Layer
}
MatMulLayer is an idiomatic wrapper over the Objective-C class MLCMatMulLayer.
It embeds Layer, promoting that type's methods.
A layer that multiplies matrices.
func MLCMatMulLayerLayerWithDescriptor ¶
func MLCMatMulLayerLayerWithDescriptor(descriptor *MatMulDescriptor) *MatMulLayer
MLCMatMulLayerLayerWithDescriptor creates a matrix multiplication layer with the specified descriptor you specify.
func MatMulLayerFromID ¶ added in v0.17.0
func MatMulLayerFromID(id objc.ID) *MatMulLayer
MatMulLayerFromID adopts an existing Objective-C object as a MatMulLayer (nil for 0), retaining it and registering a release finalizer.
func NewMatMulLayer ¶ added in v0.17.0
func NewMatMulLayer() *MatMulLayer
NewMatMulLayer creates a new MatMulLayer.
func (*MatMulLayer) Descriptor ¶ added in v0.17.0
func (mml *MatMulLayer) Descriptor() *MatMulDescriptor
Descriptor returns the matrix multiplication descriptor
func (*MatMulLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (mml *MatMulLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *MatMulLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*MatMulLayer) WithLabel ¶ added in v0.17.0
func (mml *MatMulLayer) WithLabel(label string) *MatMulLayer
WithLabel sets a string that helps identify this layer.
type MpoFlags ¶ added in v0.17.0
type MpoFlags uint32
Bitmask — values may be combined with |.
const ( MpoFlagsPort MpoFlags = 0 MpoFlagsServicePort MpoFlags = 1024 MpoFlagsConnectionPort MpoFlags = 2048 MpoFlagsReplyPort MpoFlags = 4096 MpoFlagsWeakReplyPort MpoFlags = 16384 MpoFlagsNotificationPort MpoFlags = 17408 MpoFlagsExceptionPort MpoFlags = 32768 MpoFlagsConnectionPortWithPortArray MpoFlags = 65536 )
type MultiheadAttentionDescriptor ¶ added in v0.17.0
MultiheadAttentionDescriptor is an idiomatic wrapper over the Objective-C class MLCMultiheadAttentionDescriptor.
A configuration object you use to create a multi-head attention layer.
func DescriptorWithModelDimensionHeadCount ¶ added in v0.17.0
func DescriptorWithModelDimensionHeadCount(modelDimension int, headCount int) *MultiheadAttentionDescriptor
DescriptorWithModelDimensionHeadCount creates a multi-head attention descriptor with the model dimension and number of parallel attention heads you specify.
func DescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention ¶ added in v0.17.0
func DescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention(modelDimension int, keyDimension int, valueDimension int, headCount int, dropout float32, hasBiases bool, hasAttentionBiases bool, addsZeroAttention bool) *MultiheadAttentionDescriptor
DescriptorWithModelDimensionKeyDimensionValueDimensionHeadCountDropoutHasBiasesHasAttentionBiasesAddsZeroAttention creates a multi-head attention descriptor with the dimensions, number of attention heads, dropout rate, and bias and padding options you specify.
func MultiheadAttentionDescriptorFromID ¶ added in v0.17.0
func MultiheadAttentionDescriptorFromID(id objc.ID) *MultiheadAttentionDescriptor
MultiheadAttentionDescriptorFromID adopts an existing Objective-C object as a MultiheadAttentionDescriptor (nil for 0), retaining it and registering a release finalizer.
func NewMultiheadAttentionDescriptor ¶ added in v0.17.0
func NewMultiheadAttentionDescriptor() *MultiheadAttentionDescriptor
NewMultiheadAttentionDescriptor creates a new MultiheadAttentionDescriptor.
func (*MultiheadAttentionDescriptor) AddsZeroAttention ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) AddsZeroAttention() bool
AddsZeroAttention reports whether if true, a row of zeroes is added to projected key and value. Default = false
func (*MultiheadAttentionDescriptor) Description ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) Description() string
Description returns the object's -description text.
func (*MultiheadAttentionDescriptor) Dropout ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) Dropout() float32
Dropout returns a droupout layer applied to the output projection weights. Default = 0.0
func (*MultiheadAttentionDescriptor) HasAttentionBiases ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) HasAttentionBiases() bool
HasAttentionBiases reports whether if true, an array of biases is added to key and value respectively. Default = false
func (*MultiheadAttentionDescriptor) HasBiases ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) HasBiases() bool
HasBiases reports whether if true, bias is used for query/key/value/output projections. Default = true
func (*MultiheadAttentionDescriptor) HeadCount ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) HeadCount() int
HeadCount returns number of parallel attention heads
func (*MultiheadAttentionDescriptor) IsEqual ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*MultiheadAttentionDescriptor) IsKind ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*MultiheadAttentionDescriptor) KeyDimension ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) KeyDimension() int
KeyDimension returns total dimension of key space, Default = modelDimension
func (*MultiheadAttentionDescriptor) ModelDimension ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) ModelDimension() int
ModelDimension returns model or embedding dimension
func (*MultiheadAttentionDescriptor) String ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*MultiheadAttentionDescriptor) ValueDimension ¶ added in v0.17.0
func (mad *MultiheadAttentionDescriptor) ValueDimension() int
ValueDimension returns total dimension of value space, Default = modelDimension
type MultiheadAttentionLayer ¶ added in v0.17.0
type MultiheadAttentionLayer struct {
Layer
}
MultiheadAttentionLayer is an idiomatic wrapper over the Objective-C class MLCMultiheadAttentionLayer.
It embeds Layer, promoting that type's methods.
A multihead, scaled dot-product attention layer that attends to one or more entries in the input key-value pairs.
func LayerWithDescriptorWeightsBiasesAttentionBiases ¶ added in v0.17.0
func LayerWithDescriptorWeightsBiasesAttentionBiases(descriptor *MultiheadAttentionDescriptor, weights []*Tensor, biases []*Tensor, attentionBiases []*Tensor) *MultiheadAttentionLayer
LayerWithDescriptorWeightsBiasesAttentionBiases creates a multi-head attention layer with the descriptor, weights, and biases you specify.
func MultiheadAttentionLayerFromID ¶ added in v0.17.0
func MultiheadAttentionLayerFromID(id objc.ID) *MultiheadAttentionLayer
MultiheadAttentionLayerFromID adopts an existing Objective-C object as a MultiheadAttentionLayer (nil for 0), retaining it and registering a release finalizer.
func NewMultiheadAttentionLayer ¶ added in v0.17.0
func NewMultiheadAttentionLayer() *MultiheadAttentionLayer
NewMultiheadAttentionLayer creates a new MultiheadAttentionLayer.
func (*MultiheadAttentionLayer) AttentionBiases ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) AttentionBiases() []*Tensor
AttentionBiases returns the biases added to key and value
AttentionBiases returns the collection as a Go slice.
func (*MultiheadAttentionLayer) Biases ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) Biases() []*Tensor
Biases returns the biases of query, key, value and output projections
Biases returns the collection as a Go slice.
func (*MultiheadAttentionLayer) BiasesParameters ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) BiasesParameters() []*TensorParameter
BiasesParameters returns the biases tensor parameters used for optimizer update
BiasesParameters returns the collection as a Go slice.
func (*MultiheadAttentionLayer) Descriptor ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) Descriptor() *MultiheadAttentionDescriptor
Descriptor returns the multi-head attention descriptor
func (*MultiheadAttentionLayer) Weights ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) Weights() []*Tensor
Weights returns the weights of query, key, value and output projections
Weights returns the collection as a Go slice.
func (*MultiheadAttentionLayer) WeightsParameters ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) WeightsParameters() []*TensorParameter
WeightsParameters returns the weights tensor parameters used for optimizer update
WeightsParameters returns the collection as a Go slice.
func (*MultiheadAttentionLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *MultiheadAttentionLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*MultiheadAttentionLayer) WithLabel ¶ added in v0.17.0
func (mal *MultiheadAttentionLayer) WithLabel(label string) *MultiheadAttentionLayer
WithLabel sets a string that helps identify this layer.
type Optimizer ¶ added in v0.17.0
Optimizer is an idiomatic wrapper over the Objective-C class MLCOptimizer.
Optimizer is an abstract base — you do not construct it directly. Construct one of AdamOptimizer, AdamWOptimizer, RMSPropOptimizer, SGDOptimizer and pass it where a Optimizer is accepted.
The base class for all framework optimizers.
func OptimizerFromID ¶ added in v0.17.0
OptimizerFromID adopts an existing Objective-C object as a Optimizer (nil for 0), retaining it and registering a release finalizer.
func (*Optimizer) AppliesGradientClipping ¶ added in v0.17.0
AppliesGradientClipping reports whether gradient clipping should be applied or not.
func (*Optimizer) CustomGlobalNorm ¶ added in v0.17.0
CustomGlobalNorm returns used only with MLCGradientClippingTypeByGlobalNorm. If non zero, this norm will be used in place of global norm.
func (*Optimizer) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Optimizer) GradientClipMax ¶ added in v0.17.0
GradientClipMax returns the maximum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*Optimizer) GradientClipMin ¶ added in v0.17.0
GradientClipMin returns the minimum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*Optimizer) GradientClippingType ¶ added in v0.17.0
func (o *Optimizer) GradientClippingType() GradientClippingType
GradientClippingType returns the type of clipping applied to gradient
func (*Optimizer) GradientRescale ¶ added in v0.17.0
GradientRescale returns the rescale value applied to gradients during optimizer update
func (*Optimizer) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Optimizer) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Optimizer) LearningRate ¶ added in v0.17.0
LearningRate returns the learning rate. This property is 'readwrite' so that callers can implement a 'decay' during training
func (*Optimizer) MaximumClippingNorm ¶ added in v0.17.0
MaximumClippingNorm returns the maximum clipping value
func (*Optimizer) RegularizationScale ¶ added in v0.17.0
RegularizationScale returns the regularization scale.
func (*Optimizer) RegularizationType ¶ added in v0.17.0
func (o *Optimizer) RegularizationType() RegularizationType
RegularizationType returns the regularization type.
func (*Optimizer) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Optimizer) WithAppliesGradientClipping ¶ added in v0.17.0
WithAppliesGradientClipping sets a Boolean value that indicates whether you apply gradient clipping.
func (*Optimizer) WithLearningRate ¶ added in v0.17.0
WithLearningRate sets the learning rate.
type OptimizerDescriptor ¶ added in v0.17.0
OptimizerDescriptor is an idiomatic wrapper over the Objective-C class MLCOptimizerDescriptor.
A configuration object you use to create an optimizer.
func DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale ¶ added in v0.17.0
func DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, gradientClipMax float32, gradientClipMin float32, regularizationType RegularizationType, regularizationScale float32) *OptimizerDescriptor
DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClipMaxGradientClipMinRegularizationTypeRegularizationScale creates a descriptor with the learning rate, gradient rescale, clipping option and values, and regularization type and scale that you specify.
func DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale ¶ added in v0.17.0
func DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, appliesGradientClipping bool, gradientClippingType GradientClippingType, gradientClipMax float32, gradientClipMin float32, maximumClippingNorm float32, customGlobalNorm float32, regularizationType RegularizationType, regularizationScale float32) *OptimizerDescriptor
DescriptorWithLearningRateGradientRescaleAppliesGradientClippingGradientClippingTypeGradientClipMaxGradientClipMinMaximumClippingNormCustomGlobalNormRegularizationTypeRegularizationScale creates a descriptor with the learning rate, gradient rescale, clipping option and values, and regularization type and scale that you specify.
func DescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale ¶ added in v0.17.0
func DescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale(learningRate float32, gradientRescale float32, regularizationType RegularizationType, regularizationScale float32) *OptimizerDescriptor
DescriptorWithLearningRateGradientRescaleRegularizationTypeRegularizationScale creates an optimizer descriptor with the learning rate, gradient rescale, regularization type, and regulation scale that you specify.
func NewOptimizerDescriptor ¶ added in v0.17.0
func NewOptimizerDescriptor() *OptimizerDescriptor
NewOptimizerDescriptor creates a new OptimizerDescriptor.
func OptimizerDescriptorFromID ¶ added in v0.17.0
func OptimizerDescriptorFromID(id objc.ID) *OptimizerDescriptor
OptimizerDescriptorFromID adopts an existing Objective-C object as a OptimizerDescriptor (nil for 0), retaining it and registering a release finalizer.
func (*OptimizerDescriptor) AppliesGradientClipping ¶ added in v0.17.0
func (od *OptimizerDescriptor) AppliesGradientClipping() bool
AppliesGradientClipping reports whether gradient clipping should be applied or not. The default is false
func (*OptimizerDescriptor) CustomGlobalNorm ¶ added in v0.17.0
func (od *OptimizerDescriptor) CustomGlobalNorm() float32
CustomGlobalNorm returns used only with MLCGradientClippingTypeByGlobalNorm. If non zero, this norm will be used in place of global norm.
func (*OptimizerDescriptor) Description ¶ added in v0.17.0
func (od *OptimizerDescriptor) Description() string
Description returns the object's -description text.
func (*OptimizerDescriptor) GradientClipMax ¶ added in v0.17.0
func (od *OptimizerDescriptor) GradientClipMax() float32
GradientClipMax returns the maximum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*OptimizerDescriptor) GradientClipMin ¶ added in v0.17.0
func (od *OptimizerDescriptor) GradientClipMin() float32
GradientClipMin returns the minimum gradient value if gradient clipping is enabled before gradient is rescaled.
func (*OptimizerDescriptor) GradientClippingType ¶ added in v0.17.0
func (od *OptimizerDescriptor) GradientClippingType() GradientClippingType
GradientClippingType returns the type of clipping applied to gradient
func (*OptimizerDescriptor) GradientRescale ¶ added in v0.17.0
func (od *OptimizerDescriptor) GradientRescale() float32
GradientRescale returns the rescale value applied to gradients during optimizer update
func (*OptimizerDescriptor) IsEqual ¶ added in v0.17.0
func (od *OptimizerDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*OptimizerDescriptor) IsKind ¶ added in v0.17.0
func (od *OptimizerDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*OptimizerDescriptor) LearningRate ¶ added in v0.17.0
func (od *OptimizerDescriptor) LearningRate() float32
LearningRate returns the learning rate
func (*OptimizerDescriptor) MaximumClippingNorm ¶ added in v0.17.0
func (od *OptimizerDescriptor) MaximumClippingNorm() float32
MaximumClippingNorm returns the maximum clipping value
func (*OptimizerDescriptor) RegularizationScale ¶ added in v0.17.0
func (od *OptimizerDescriptor) RegularizationScale() float32
RegularizationScale returns the regularization scale.
func (*OptimizerDescriptor) RegularizationType ¶ added in v0.17.0
func (od *OptimizerDescriptor) RegularizationType() RegularizationType
RegularizationType returns the regularization type.
func (*OptimizerDescriptor) String ¶ added in v0.17.0
func (od *OptimizerDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type OptimizerProvider ¶ added in v0.17.0
OptimizerProvider is accepted wherever a MLCOptimizer (or one of its subclasses) is expected.
type PaddingLayer ¶ added in v0.17.0
type PaddingLayer struct {
Layer
}
PaddingLayer is an idiomatic wrapper over the Objective-C class MLCPaddingLayer.
It embeds Layer, promoting that type's methods.
A layer that pads a tensor with the padding sizes you specify.
func LayerWithConstantPaddingConstantValue ¶ added in v0.17.0
func LayerWithConstantPaddingConstantValue(padding []*foundation.Number, constantValue float32) *PaddingLayer
LayerWithConstantPaddingConstantValue creates a padding layer with the constant padding sizes and constant valu you specify.
func LayerWithReflectionPadding ¶ added in v0.17.0
func LayerWithReflectionPadding(padding []*foundation.Number) *PaddingLayer
LayerWithReflectionPadding creates a padding layer with the reflection padding sizes you specify.
func LayerWithSymmetricPadding ¶ added in v0.17.0
func LayerWithSymmetricPadding(padding []*foundation.Number) *PaddingLayer
LayerWithSymmetricPadding creates a padding layer with the symmetric padding sizes you specify.
func LayerWithZeroPadding ¶ added in v0.17.0
func LayerWithZeroPadding(padding []*foundation.Number) *PaddingLayer
LayerWithZeroPadding creates a padding layer with the zero padding sizes you specify.
func NewPaddingLayer ¶ added in v0.17.0
func NewPaddingLayer() *PaddingLayer
NewPaddingLayer creates a new PaddingLayer.
func PaddingLayerFromID ¶ added in v0.17.0
func PaddingLayerFromID(id objc.ID) *PaddingLayer
PaddingLayerFromID adopts an existing Objective-C object as a PaddingLayer (nil for 0), retaining it and registering a release finalizer.
func (*PaddingLayer) ConstantValue ¶ added in v0.17.0
func (pl *PaddingLayer) ConstantValue() float32
ConstantValue returns the constant value to use if padding type is constant.
func (*PaddingLayer) PaddingBottom ¶ added in v0.17.0
func (pl *PaddingLayer) PaddingBottom() int
PaddingBottom returns the bottom padding size
func (*PaddingLayer) PaddingLeft ¶ added in v0.17.0
func (pl *PaddingLayer) PaddingLeft() int
PaddingLeft returns the left padding size
func (*PaddingLayer) PaddingRight ¶ added in v0.17.0
func (pl *PaddingLayer) PaddingRight() int
PaddingRight returns the right padding size
func (*PaddingLayer) PaddingTop ¶ added in v0.17.0
func (pl *PaddingLayer) PaddingTop() int
PaddingTop returns the top padding size
func (*PaddingLayer) PaddingType ¶ added in v0.17.0
func (pl *PaddingLayer) PaddingType() PaddingType
PaddingType returns the padding type i.e. constant, zero, reflect or symmetric
func (*PaddingLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (pl *PaddingLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *PaddingLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*PaddingLayer) WithLabel ¶ added in v0.17.0
func (pl *PaddingLayer) WithLabel(label string) *PaddingLayer
WithLabel sets a string that helps identify this layer.
type PaddingPolicy ¶ added in v0.17.0
type PaddingPolicy int32
A padding policy that you specify for a convolution or pooling layer.
const ( // The "same" padding policy. PaddingPolicySame PaddingPolicy = 0 // The "valid" padding policy. PaddingPolicyValid PaddingPolicy = 1 // The choice to use explicitly specified padding sizes. PaddingPolicyUsePaddingSize PaddingPolicy = 2 )
func (PaddingPolicy) String ¶ added in v0.17.0
func (e PaddingPolicy) String() string
String returns the PaddingPolicy constant's name, or its numeric form when the value is not a known constant.
type PaddingType ¶ added in v0.17.0
type PaddingType int32
A padding type that you specify for a padding layer.
const ( // The zero padding type. PaddingTypeZero PaddingType = 0 // The reflect padding type. PaddingTypeReflect PaddingType = 1 // The symmetric padding type. PaddingTypeSymmetric PaddingType = 2 // The constant padding type. PaddingTypeConstant PaddingType = 3 )
func (PaddingType) String ¶ added in v0.17.0
func (e PaddingType) String() string
String returns the PaddingType constant's name, or its numeric form when the value is not a known constant.
type Perm ¶ added in v0.17.0
type Perm int32
const ( PermReadData Perm = 2 PermListDirectory Perm = 2 PermWriteData Perm = 4 PermAddFile Perm = 4 PermExecute Perm = 8 PermSearch Perm = 8 PermDelete Perm = 16 PermAppendData Perm = 32 PermAddSubdirectory Perm = 32 PermDeleteChild Perm = 64 PermReadAttributes Perm = 128 PermWriteAttributes Perm = 256 PermReadExtattributes Perm = 512 PermWriteExtattributes Perm = 1024 PermReadSecurity Perm = 2048 PermWriteSecurity Perm = 4096 PermChangeOwner Perm = 8192 PermSynchronize Perm = 1048576 )
type Platform ¶ added in v0.17.0
Platform is an idiomatic wrapper over the Objective-C class MLCPlatform.
A utility class for setting global properties in the framework.
func NewPlatform ¶ added in v0.17.0
func NewPlatform() *Platform
NewPlatform creates a new Platform.
func PlatformFromID ¶ added in v0.17.0
PlatformFromID adopts an existing Objective-C object as a Platform (nil for 0), retaining it and registering a release finalizer.
func (*Platform) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Platform) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
type PoolingDescriptor ¶ added in v0.17.0
PoolingDescriptor is an idiomatic wrapper over the Objective-C class MLCPoolingDescriptor.
A configuration object you use to create a pooling layer.
func AveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding ¶ added in v0.17.0
func AveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes []*foundation.Number, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number, countIncludesPadding bool) *PoolingDescriptor
AveragePoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizesCountIncludesPadding creates an average pooling descriptor with the kernel sizes, strides, dilution rates, padding policy and sizes, and zero padding option you specify.
func AveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding ¶ added in v0.17.0
func AveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding(kernelSizes []*foundation.Number, strides []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number, countIncludesPadding bool) *PoolingDescriptor
AveragePoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizesCountIncludesPadding creates an average pooling descriptor with the kernel sizes, strides, padding policy, padding sizes, and zero padding option that you specify.
func L2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func L2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *PoolingDescriptor
L2NormPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes creates a descriptor for an L2 norm pooling function with the kernel sizes, strides, dilation rates, padding policy, and padding sizes you specify.
func L2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func L2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *PoolingDescriptor
L2NormPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes creates a descriptor for an L2 norm pooling function with the kernel sizes, strides, padding policy, and padding sizes that you specify.
func MaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func MaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, dilationRates []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *PoolingDescriptor
MaxPoolingDescriptorWithKernelSizesStridesDilationRatesPaddingPolicyPaddingSizes creates a descriptor for a max pooling function with the kernel sizes, strides, dilation rates, padding policy, and padding sizes that you specify.
func MaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes ¶ added in v0.17.0
func MaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes(kernelSizes []*foundation.Number, strides []*foundation.Number, paddingPolicy PaddingPolicy, paddingSizes []*foundation.Number) *PoolingDescriptor
MaxPoolingDescriptorWithKernelSizesStridesPaddingPolicyPaddingSizes creates a descriptor for a max pooling function with the kernel sizes, strides, padding policy, and padding sizes that you specify.
func NewPoolingDescriptor ¶ added in v0.17.0
func NewPoolingDescriptor() *PoolingDescriptor
NewPoolingDescriptor creates a new PoolingDescriptor.
func PoolingDescriptorFromID ¶ added in v0.17.0
func PoolingDescriptorFromID(id objc.ID) *PoolingDescriptor
PoolingDescriptorFromID adopts an existing Objective-C object as a PoolingDescriptor (nil for 0), retaining it and registering a release finalizer.
func PoolingDescriptorWithTypeKernelSizeStride ¶ added in v0.17.0
func PoolingDescriptorWithTypeKernelSizeStride(poolingType PoolingType, kernelSize int, stride int) *PoolingDescriptor
PoolingDescriptorWithTypeKernelSizeStride creates a pooling descriptor with the pooling function, kernel size, and stride you specify.
func (*PoolingDescriptor) CountIncludesPadding ¶ added in v0.17.0
func (pd *PoolingDescriptor) CountIncludesPadding() bool
CountIncludesPadding reports whether include the zero-padding in the averaging calculation if true. Used only with average pooling.
func (*PoolingDescriptor) Description ¶ added in v0.17.0
func (pd *PoolingDescriptor) Description() string
Description returns the object's -description text.
func (*PoolingDescriptor) DilationRateInX ¶ added in v0.17.0
func (pd *PoolingDescriptor) DilationRateInX() int
DilationRateInX returns the dilation rate i.e. stride of elements in the kernel in x.
func (*PoolingDescriptor) DilationRateInY ¶ added in v0.17.0
func (pd *PoolingDescriptor) DilationRateInY() int
DilationRateInY returns the dilation rate i.e. stride of elements in the kernel in y.
func (*PoolingDescriptor) IsEqual ¶ added in v0.17.0
func (pd *PoolingDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*PoolingDescriptor) IsKind ¶ added in v0.17.0
func (pd *PoolingDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*PoolingDescriptor) KernelHeight ¶ added in v0.17.0
func (pd *PoolingDescriptor) KernelHeight() int
KernelHeight returns the pooling kernel size in y.
func (*PoolingDescriptor) KernelWidth ¶ added in v0.17.0
func (pd *PoolingDescriptor) KernelWidth() int
KernelWidth returns the pooling kernel size in x.
func (*PoolingDescriptor) PaddingPolicy ¶ added in v0.17.0
func (pd *PoolingDescriptor) PaddingPolicy() PaddingPolicy
PaddingPolicy returns the padding policy to use.
func (*PoolingDescriptor) PaddingSizeInX ¶ added in v0.17.0
func (pd *PoolingDescriptor) PaddingSizeInX() int
PaddingSizeInX returns the padding size in x (left and right) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*PoolingDescriptor) PaddingSizeInY ¶ added in v0.17.0
func (pd *PoolingDescriptor) PaddingSizeInY() int
PaddingSizeInY returns the padding size in y (top and bottom) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
func (*PoolingDescriptor) PoolingType ¶ added in v0.17.0
func (pd *PoolingDescriptor) PoolingType() PoolingType
PoolingType returns the pooling operation
func (*PoolingDescriptor) StrideInX ¶ added in v0.17.0
func (pd *PoolingDescriptor) StrideInX() int
StrideInX returns the stride of the kernel in x.
func (*PoolingDescriptor) StrideInY ¶ added in v0.17.0
func (pd *PoolingDescriptor) StrideInY() int
StrideInY returns the stride of the kernel in y.
func (*PoolingDescriptor) String ¶ added in v0.17.0
func (pd *PoolingDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type PoolingLayer ¶ added in v0.17.0
type PoolingLayer struct {
Layer
}
PoolingLayer is an idiomatic wrapper over the Objective-C class MLCPoolingLayer.
It embeds Layer, promoting that type's methods.
A layer that summarizes the average presence of a feature.
func MLCPoolingLayerLayerWithDescriptor ¶
func MLCPoolingLayerLayerWithDescriptor(descriptor *PoolingDescriptor) *PoolingLayer
MLCPoolingLayerLayerWithDescriptor creates a pooling layer with the descriptor you specify.
func NewPoolingLayer ¶ added in v0.17.0
func NewPoolingLayer() *PoolingLayer
NewPoolingLayer creates a new PoolingLayer.
func PoolingLayerFromID ¶ added in v0.17.0
func PoolingLayerFromID(id objc.ID) *PoolingLayer
PoolingLayerFromID adopts an existing Objective-C object as a PoolingLayer (nil for 0), retaining it and registering a release finalizer.
func (*PoolingLayer) Descriptor ¶ added in v0.17.0
func (pl *PoolingLayer) Descriptor() *PoolingDescriptor
Descriptor returns the pooling descriptor
func (*PoolingLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (pl *PoolingLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *PoolingLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*PoolingLayer) WithLabel ¶ added in v0.17.0
func (pl *PoolingLayer) WithLabel(label string) *PoolingLayer
WithLabel sets a string that helps identify this layer.
type PoolingType ¶ added in v0.17.0
type PoolingType int32
A pooling function type for a pooling layer.
const ( // The max pooling type. PoolingTypeMax PoolingType = 1 // The average pooling type. PoolingTypeAverage PoolingType = 2 // The L2-norm pooling type. PoolingTypeL2Norm PoolingType = 3 PoolingTypeCount PoolingType = 4 )
func (PoolingType) String ¶ added in v0.17.0
func (e PoolingType) String() string
String returns the PoolingType constant's name, or its numeric form when the value is not a known constant.
type PtrauthKey ¶ added in v0.17.0
type PtrauthKey int32
const ( Ptrauth_key_none PtrauthKey = -1 Ptrauth_key_asia PtrauthKey = 0 Ptrauth_key_asib PtrauthKey = 1 Ptrauth_key_asda PtrauthKey = 2 Ptrauth_key_asdb PtrauthKey = 3 Ptrauth_key_process_independent_code PtrauthKey = 0 Ptrauth_key_process_dependent_code PtrauthKey = 1 Ptrauth_key_process_independent_data PtrauthKey = 2 Ptrauth_key_process_dependent_data PtrauthKey = 3 Ptrauth_key_return_address PtrauthKey = 1 Ptrauth_key_frame_pointer PtrauthKey = 3 Ptrauth_key_function_pointer PtrauthKey = 0 Ptrauth_key_block_function PtrauthKey = 0 Ptrauth_key_cxx_vtable_pointer PtrauthKey = 2 Ptrauth_key_method_list_pointer PtrauthKey = 2 Ptrauth_key_objc_isa_pointer PtrauthKey = 2 Ptrauth_key_objc_super_pointer PtrauthKey = 2 Ptrauth_key_objc_sel_pointer PtrauthKey = 3 Ptrauth_key_objc_class_ro_pointer PtrauthKey = 2 Ptrauth_key_block_descriptor_pointer PtrauthKey = 2 Ptrauth_key_init_fini_pointer PtrauthKey = 0 )
func (PtrauthKey) String ¶ added in v0.17.0
func (e PtrauthKey) String() string
String returns the PtrauthKey constant's name, or its numeric form when the value is not a known constant.
type RMSPropOptimizer ¶ added in v0.17.0
type RMSPropOptimizer struct {
Optimizer
}
RMSPropOptimizer is an idiomatic wrapper over the Objective-C class MLCRMSPropOptimizer.
It embeds Optimizer, promoting that type's methods.
An optimizer that represents the root mean square propagation algorithm.
func MLCRMSPropOptimizerOptimizerWithDescriptor ¶
func MLCRMSPropOptimizerOptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *RMSPropOptimizer
MLCRMSPropOptimizerOptimizerWithDescriptor creates an RMSProp optimizer with the descriptor you specify.
func NewRMSPropOptimizer ¶ added in v0.17.0
func NewRMSPropOptimizer() *RMSPropOptimizer
NewRMSPropOptimizer creates a new RMSPropOptimizer.
func OptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered ¶ added in v0.17.0
func OptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered(optimizerDescriptor *OptimizerDescriptor, momentumScale float32, alpha float32, epsilon float32, isCentered bool) *RMSPropOptimizer
OptimizerWithDescriptorMomentumScaleAlphaEpsilonIsCentered creates an RMSProp optimizer with the descriptor, momentum scale, smoothing, epsilon, and option to compute the centered RMSProp that you specify.
func RMSPropOptimizerFromID ¶ added in v0.17.0
func RMSPropOptimizerFromID(id objc.ID) *RMSPropOptimizer
RMSPropOptimizerFromID adopts an existing Objective-C object as a RMSPropOptimizer (nil for 0), retaining it and registering a release finalizer.
func (*RMSPropOptimizer) Alpha ¶ added in v0.17.0
func (rpo *RMSPropOptimizer) Alpha() float32
Alpha returns the smoothing constant. The default is 0.99.
func (*RMSPropOptimizer) Epsilon ¶ added in v0.17.0
func (rpo *RMSPropOptimizer) Epsilon() float32
Epsilon returns a term added to improve numerical stability. The default is 1e-8.
func (*RMSPropOptimizer) IsCentered ¶ added in v0.17.0
func (rpo *RMSPropOptimizer) IsCentered() bool
IsCentered reports whether if True, compute the centered RMSProp, the gradient is normalized by an estimation of its variance. The default is false.
func (*RMSPropOptimizer) MomentumScale ¶ added in v0.17.0
func (rpo *RMSPropOptimizer) MomentumScale() float32
MomentumScale returns the momentum factor. A hyper-parameter. The default is 0.0.
func (*RMSPropOptimizer) WithAppliesGradientClipping ¶ added in v0.17.0
func (rpo *RMSPropOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *RMSPropOptimizer
WithAppliesGradientClipping sets a Boolean value that indicates whether you apply gradient clipping.
func (*RMSPropOptimizer) WithLearningRate ¶ added in v0.17.0
func (rpo *RMSPropOptimizer) WithLearningRate(learningRate float32) *RMSPropOptimizer
WithLearningRate sets the learning rate.
type RandomInitializerType ¶ added in v0.17.0
type RandomInitializerType int32
An initializer type you use to create a tensor with random data.
const ( RandomInitializerTypeInvalid RandomInitializerType = 0 // The uniform random initializer type. RandomInitializerTypeUniform RandomInitializerType = 1 // The glorot uniform random initializer type. RandomInitializerTypeGlorotUniform RandomInitializerType = 2 // The Xavier random initializer type. RandomInitializerTypeXavier RandomInitializerType = 3 RandomInitializerTypeCount RandomInitializerType = 4 )
func (RandomInitializerType) String ¶ added in v0.17.0
func (e RandomInitializerType) String() string
String returns the RandomInitializerType constant's name, or its numeric form when the value is not a known constant.
type ReductionLayer ¶ added in v0.17.0
type ReductionLayer struct {
Layer
}
ReductionLayer is an idiomatic wrapper over the Objective-C class MLCReductionLayer.
It embeds Layer, promoting that type's methods.
A layer that reduces tensor values across a specific dimension to a scalar value.
func LayerWithReductionTypeDimension ¶ added in v0.17.0
func LayerWithReductionTypeDimension(reductionType ReductionType, dimension int) *ReductionLayer
LayerWithReductionTypeDimension creates a reduction layer using the reduction type and dimension you specify.
func LayerWithReductionTypeDimensions ¶ added in v0.17.0
func LayerWithReductionTypeDimensions(reductionType ReductionType, dimensions []*foundation.Number) *ReductionLayer
LayerWithReductionTypeDimensions creates a reduction layer using the reduction type and dimensions you specify.
func NewReductionLayer ¶ added in v0.17.0
func NewReductionLayer() *ReductionLayer
NewReductionLayer creates a new ReductionLayer.
func ReductionLayerFromID ¶ added in v0.17.0
func ReductionLayerFromID(id objc.ID) *ReductionLayer
ReductionLayerFromID adopts an existing Objective-C object as a ReductionLayer (nil for 0), retaining it and registering a release finalizer.
func (*ReductionLayer) Dimension ¶ added in v0.17.0
func (rl *ReductionLayer) Dimension() int
Dimension returns the dimension over which to perform the reduction operation
func (*ReductionLayer) Dimensions ¶ added in v0.17.0
func (rl *ReductionLayer) Dimensions() []obj.Object
Dimensions returns the dimensions over which to perform the reduction operation
Dimensions returns the collection as a Go slice.
func (*ReductionLayer) ReductionType ¶ added in v0.17.0
func (rl *ReductionLayer) ReductionType() ReductionType
ReductionType returns the reduction type
func (*ReductionLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (rl *ReductionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ReductionLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ReductionLayer) WithLabel ¶ added in v0.17.0
func (rl *ReductionLayer) WithLabel(label string) *ReductionLayer
WithLabel sets a string that helps identify this layer.
type ReductionType ¶ added in v0.17.0
type ReductionType int32
Constants that describe a reduction operation type.
const ( // A reduction operation that applies no reduction. ReductionTypeNone ReductionType = 0 // A reduction operation that applies to the sum of the dimensions. ReductionTypeSum ReductionType = 1 // A reduction operation that applies to the mean of the dimensions. ReductionTypeMean ReductionType = 2 // A reduction operation that applies to the maximum dimension. ReductionTypeMax ReductionType = 3 // A reduction operation that applies to the minimum dimension. ReductionTypeMin ReductionType = 4 // A reduction operation that applies to the maximum dimension you specify. ReductionTypeArgMax ReductionType = 5 // A reduction operation that applies to the minimum dimension you specify. ReductionTypeArgMin ReductionType = 6 // A reduction operation that applies a lasso regularization penalty. ReductionTypeL1Norm ReductionType = 7 // A reduction operation that applies to any dimension. ReductionTypeAny ReductionType = 8 // A reduction operation that applies to all dimensions. ReductionTypeAll ReductionType = 9 // The total number of reduction operations. ReductionTypeCount ReductionType = 10 )
func (ReductionType) String ¶ added in v0.17.0
func (e ReductionType) String() string
String returns the ReductionType constant's name, or its numeric form when the value is not a known constant.
type RegularizationType ¶ added in v0.17.0
type RegularizationType int32
A regularization function to use with an optimizer.
const ( // No regularization. RegularizationTypeNone RegularizationType = 0 // The L1 regularization. RegularizationTypeL1 RegularizationType = 1 // The L2 regularization. RegularizationTypeL2 RegularizationType = 2 )
func (RegularizationType) String ¶ added in v0.17.0
func (e RegularizationType) String() string
String returns the RegularizationType constant's name, or its numeric form when the value is not a known constant.
type ReshapeLayer ¶ added in v0.17.0
type ReshapeLayer struct {
Layer
}
ReshapeLayer is an idiomatic wrapper over the Objective-C class MLCReshapeLayer.
It embeds Layer, promoting that type's methods.
A layer that reshapes a tensor with the shape you specify.
func LayerWithShape ¶ added in v0.17.0
func LayerWithShape(shape []*foundation.Number) *ReshapeLayer
LayerWithShape creates a reshape layer with the shape you specify.
func NewReshapeLayer ¶ added in v0.17.0
func NewReshapeLayer() *ReshapeLayer
NewReshapeLayer creates a new ReshapeLayer.
func ReshapeLayerFromID ¶ added in v0.17.0
func ReshapeLayerFromID(id objc.ID) *ReshapeLayer
ReshapeLayerFromID adopts an existing Objective-C object as a ReshapeLayer (nil for 0), retaining it and registering a release finalizer.
func (*ReshapeLayer) Shape ¶ added in v0.17.0
func (rl *ReshapeLayer) Shape() []obj.Object
Shape returns the target shape.
Shape returns the collection as a Go slice.
func (*ReshapeLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (rl *ReshapeLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ReshapeLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ReshapeLayer) WithLabel ¶ added in v0.17.0
func (rl *ReshapeLayer) WithLabel(label string) *ReshapeLayer
WithLabel sets a string that helps identify this layer.
type SGDOptimizer ¶ added in v0.17.0
type SGDOptimizer struct {
Optimizer
}
SGDOptimizer is an idiomatic wrapper over the Objective-C class MLCSGDOptimizer.
It embeds Optimizer, promoting that type's methods.
An optimizer that represents the stochastic gradient decent algorithm.
func MLCSGDOptimizerOptimizerWithDescriptor ¶
func MLCSGDOptimizerOptimizerWithDescriptor(optimizerDescriptor *OptimizerDescriptor) *SGDOptimizer
MLCSGDOptimizerOptimizerWithDescriptor creates an SGD optimizer with the descriptor you specify.
func NewSGDOptimizer ¶ added in v0.17.0
func NewSGDOptimizer() *SGDOptimizer
NewSGDOptimizer creates a new SGDOptimizer.
func OptimizerWithDescriptorMomentumScaleUsesNesterovMomentum ¶ added in v0.17.0
func OptimizerWithDescriptorMomentumScaleUsesNesterovMomentum(optimizerDescriptor *OptimizerDescriptor, momentumScale float32, usesNesterovMomentum bool) *SGDOptimizer
OptimizerWithDescriptorMomentumScaleUsesNesterovMomentum create an SGD optimizer with the descriptor, momentum scale, and option to enable Nesterov momentum that you specify.
func SGDOptimizerFromID ¶ added in v0.17.0
func SGDOptimizerFromID(id objc.ID) *SGDOptimizer
SGDOptimizerFromID adopts an existing Objective-C object as a SGDOptimizer (nil for 0), retaining it and registering a release finalizer.
func (*SGDOptimizer) MomentumScale ¶ added in v0.17.0
func (so *SGDOptimizer) MomentumScale() float32
MomentumScale returns the momentum factor. A hyper-parameter. The default is 0.0.
func (*SGDOptimizer) UsesNesterovMomentum ¶ added in v0.17.0
func (so *SGDOptimizer) UsesNesterovMomentum() bool
UsesNesterovMomentum reports whether a boolean that specifies whether to apply nesterov momentum or not. The default is false.
func (*SGDOptimizer) WithAppliesGradientClipping ¶ added in v0.17.0
func (so *SGDOptimizer) WithAppliesGradientClipping(appliesGradientClipping bool) *SGDOptimizer
WithAppliesGradientClipping sets a Boolean value that indicates whether you apply gradient clipping.
func (*SGDOptimizer) WithLearningRate ¶ added in v0.17.0
func (so *SGDOptimizer) WithLearningRate(learningRate float32) *SGDOptimizer
WithLearningRate sets the learning rate.
type SampleMode ¶ added in v0.17.0
type SampleMode int32
A sampling mode for an upsample layer.
const ( // The nearest sample mode. SampleModeNearest SampleMode = 0 // The linear sample mode. SampleModeLinear SampleMode = 1 )
func (SampleMode) String ¶ added in v0.17.0
func (e SampleMode) String() string
String returns the SampleMode constant's name, or its numeric form when the value is not a known constant.
type ScatterLayer ¶ added in v0.17.0
type ScatterLayer struct {
Layer
}
ScatterLayer is an idiomatic wrapper over the Objective-C class MLCScatterLayer.
It embeds Layer, promoting that type's methods.
A layer that updates the output at an index you specify.
func LayerWithDimensionReductionType ¶ added in v0.17.0
func LayerWithDimensionReductionType(dimension int, reductionType ReductionType) *ScatterLayer
LayerWithDimensionReductionType creates a scatter layer with the dimension and reduction type you specify.
func NewScatterLayer ¶ added in v0.17.0
func NewScatterLayer() *ScatterLayer
NewScatterLayer creates a new ScatterLayer.
func ScatterLayerFromID ¶ added in v0.17.0
func ScatterLayerFromID(id objc.ID) *ScatterLayer
ScatterLayerFromID adopts an existing Objective-C object as a ScatterLayer (nil for 0), retaining it and registering a release finalizer.
func (*ScatterLayer) Dimension ¶ added in v0.17.0
func (sl *ScatterLayer) Dimension() int
Dimension returns the dimension along which to index
func (*ScatterLayer) ReductionType ¶ added in v0.17.0
func (sl *ScatterLayer) ReductionType() ReductionType
ReductionType returns 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.
func (*ScatterLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (sl *ScatterLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *ScatterLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*ScatterLayer) WithLabel ¶ added in v0.17.0
func (sl *ScatterLayer) WithLabel(label string) *ScatterLayer
WithLabel sets a string that helps identify this layer.
type SelectionLayer ¶ added in v0.17.0
type SelectionLayer struct {
Layer
}
SelectionLayer is an idiomatic wrapper over the Objective-C class MLCSelectionLayer.
It embeds Layer, promoting that type's methods.
A layer for selecting elements from two tensors.
func MLCSelectionLayerLayer ¶
func MLCSelectionLayerLayer() *SelectionLayer
MLCSelectionLayerLayer creates a selection layer.
func NewSelectionLayer ¶ added in v0.17.0
func NewSelectionLayer() *SelectionLayer
NewSelectionLayer creates a new SelectionLayer.
func SelectionLayerFromID ¶ added in v0.17.0
func SelectionLayerFromID(id objc.ID) *SelectionLayer
SelectionLayerFromID adopts an existing Objective-C object as a SelectionLayer (nil for 0), retaining it and registering a release finalizer.
func (*SelectionLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (sl *SelectionLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *SelectionLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*SelectionLayer) WithLabel ¶ added in v0.17.0
func (sl *SelectionLayer) WithLabel(label string) *SelectionLayer
WithLabel sets a string that helps identify this layer.
type SliceLayer ¶ added in v0.17.0
type SliceLayer struct {
Layer
}
SliceLayer is an idiomatic wrapper over the Objective-C class MLCSliceLayer.
It embeds Layer, promoting that type's methods.
A layer that extracts a slice from a tensor.
func NewSliceLayer ¶ added in v0.17.0
func NewSliceLayer() *SliceLayer
NewSliceLayer creates a new SliceLayer.
func SliceLayerFromID ¶ added in v0.17.0
func SliceLayerFromID(id objc.ID) *SliceLayer
SliceLayerFromID adopts an existing Objective-C object as a SliceLayer (nil for 0), retaining it and registering a release finalizer.
func SliceLayerWithStartEndStride ¶ added in v0.17.0
func SliceLayerWithStartEndStride(start []*foundation.Number, end []*foundation.Number, stride []*foundation.Number) *SliceLayer
SliceLayerWithStartEndStride creates a slice layer with the specified start, end, and stride.
func (*SliceLayer) End ¶ added in v0.17.0
func (sl *SliceLayer) End() []obj.Object
End returns a vector of length equal to that of source. The element at index i specifies the end of slice in dimension i.
End returns the collection as a Go slice.
func (*SliceLayer) Start ¶ added in v0.17.0
func (sl *SliceLayer) Start() []obj.Object
Start returns a vector of length equal to that of source. The element at index i specifies the beginning of slice in dimension i.
Start returns the collection as a Go slice.
func (*SliceLayer) Stride ¶ added in v0.17.0
func (sl *SliceLayer) Stride() []obj.Object
Stride returns a vector of length equal to that of source. The element at index i specifies the stride of slice in dimension i.
Stride returns the collection as a Go slice.
func (*SliceLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (sl *SliceLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *SliceLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*SliceLayer) WithLabel ¶ added in v0.17.0
func (sl *SliceLayer) WithLabel(label string) *SliceLayer
WithLabel sets a string that helps identify this layer.
type SoftmaxLayer ¶ added in v0.17.0
type SoftmaxLayer struct {
Layer
}
SoftmaxLayer is an idiomatic wrapper over the Objective-C class MLCSoftmaxLayer.
It embeds Layer, promoting that type's methods.
A layer that outputs a probability distribution as attention weights.
func LayerWithOperationDimension ¶ added in v0.17.0
func LayerWithOperationDimension(operation SoftmaxOperation, dimension int) *SoftmaxLayer
LayerWithOperationDimension creates a softmax layer with the operation and dimension you specify.
func MLCSoftmaxLayerLayerWithOperation ¶
func MLCSoftmaxLayerLayerWithOperation(operation SoftmaxOperation) *SoftmaxLayer
MLCSoftmaxLayerLayerWithOperation creates a softmax layer with the operation you specify.
func NewSoftmaxLayer ¶ added in v0.17.0
func NewSoftmaxLayer() *SoftmaxLayer
NewSoftmaxLayer creates a new SoftmaxLayer.
func SoftmaxLayerFromID ¶ added in v0.17.0
func SoftmaxLayerFromID(id objc.ID) *SoftmaxLayer
SoftmaxLayerFromID adopts an existing Objective-C object as a SoftmaxLayer (nil for 0), retaining it and registering a release finalizer.
func (*SoftmaxLayer) Dimension ¶ added in v0.17.0
func (sl *SoftmaxLayer) Dimension() int
Dimension returns the dimension over which softmax operation should be performed
func (*SoftmaxLayer) Operation ¶ added in v0.17.0
func (sl *SoftmaxLayer) Operation() SoftmaxOperation
Operation returns the softmax operation. Supported values are softmax and log softmax.
func (*SoftmaxLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (sl *SoftmaxLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *SoftmaxLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*SoftmaxLayer) WithLabel ¶ added in v0.17.0
func (sl *SoftmaxLayer) WithLabel(label string) *SoftmaxLayer
WithLabel sets a string that helps identify this layer.
type SoftmaxOperation ¶ added in v0.17.0
type SoftmaxOperation int32
A softmax operation.
const ( // The standard softmax operation. SoftmaxOperationSoftmax SoftmaxOperation = 0 // The log softmax operation. SoftmaxOperationLogSoftmax SoftmaxOperation = 1 )
func (SoftmaxOperation) String ¶ added in v0.17.0
func (e SoftmaxOperation) String() string
String returns the SoftmaxOperation constant's name, or its numeric form when the value is not a known constant.
type SplitLayer ¶ added in v0.17.0
type SplitLayer struct {
Layer
}
SplitLayer is an idiomatic wrapper over the Objective-C class MLCSplitLayer.
It embeds Layer, promoting that type's methods.
A layer that splits a tensor value into a list of subtensors.
func LayerWithSplitCountDimension ¶ added in v0.17.0
func LayerWithSplitCountDimension(splitCount int, dimension int) *SplitLayer
LayerWithSplitCountDimension creates a split layer with the number of splits and dimension you specify.
func LayerWithSplitSectionLengthsDimension ¶ added in v0.17.0
func LayerWithSplitSectionLengthsDimension(splitSectionLengths []*foundation.Number, dimension int) *SplitLayer
LayerWithSplitSectionLengthsDimension creates a split layer with the lengths of each split section and dimension you specify.
func NewSplitLayer ¶ added in v0.17.0
func NewSplitLayer() *SplitLayer
NewSplitLayer creates a new SplitLayer.
func SplitLayerFromID ¶ added in v0.17.0
func SplitLayerFromID(id objc.ID) *SplitLayer
SplitLayerFromID adopts an existing Objective-C object as a SplitLayer (nil for 0), retaining it and registering a release finalizer.
func (*SplitLayer) Dimension ¶ added in v0.17.0
func (sl *SplitLayer) Dimension() int
Dimension returns the dimension (or axis) along which to split tensor
func (*SplitLayer) SplitCount ¶ added in v0.17.0
func (sl *SplitLayer) SplitCount() int
SplitCount returns the number of splits. The tensor will be split into equally sized chunks. The last chunk may be smaller in size.
func (*SplitLayer) SplitSectionLengths ¶ added in v0.17.0
func (sl *SplitLayer) SplitSectionLengths() []obj.Object
SplitSectionLengths returns lengths of each split section. The tensor will be split into chunks along dimensions with sizes given in \p splitSectionLengths .
SplitSectionLengths returns the collection as a Go slice.
func (*SplitLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (sl *SplitLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *SplitLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*SplitLayer) WithLabel ¶ added in v0.17.0
func (sl *SplitLayer) WithLabel(label string) *SplitLayer
WithLabel sets a string that helps identify this layer.
type Tensor ¶ added in v0.17.0
Tensor is an idiomatic wrapper over the Objective-C class MLCTensor.
The data object you use throughout the framework.
func TensorFromID ¶ added in v0.17.0
TensorFromID adopts an existing Objective-C object as a Tensor (nil for 0), retaining it and registering a release finalizer.
func TensorWithDescriptor ¶ added in v0.17.0
func TensorWithDescriptor(tensorDescriptor *TensorDescriptor) *Tensor
TensorWithDescriptor creates a tensor without data, using the descriptor you specify.
func TensorWithDescriptorData ¶ added in v0.17.0
func TensorWithDescriptorData(tensorDescriptor *TensorDescriptor, data *TensorData) *Tensor
TensorWithDescriptorData creates a tensor with the descriptor and data you specify.
func TensorWithDescriptorFillWithData ¶ added in v0.17.0
func TensorWithDescriptorFillWithData(tensorDescriptor *TensorDescriptor, fillData obj.Object) *Tensor
TensorWithDescriptorFillWithData creates a tensor with the descriptor and scalar value you specify.
func TensorWithDescriptorRandomInitializerType ¶ added in v0.17.0
func TensorWithDescriptorRandomInitializerType(tensorDescriptor *TensorDescriptor, randomInitializerType RandomInitializerType) *Tensor
TensorWithDescriptorRandomInitializerType creates a tensor with the descriptor and random initializer type you specify.
func TensorWithSequenceLengthFeatureChannelCountBatchSize ¶ added in v0.17.0
func TensorWithSequenceLengthFeatureChannelCountBatchSize(sequenceLength int, featureChannelCount int, batchSize int) *Tensor
TensorWithSequenceLengthFeatureChannelCountBatchSize creates a tensor without data, with the sequence length, number of feature channels, and batch size you specify.
func TensorWithSequenceLengthFeatureChannelCountBatchSizeData ¶ added in v0.17.0
func TensorWithSequenceLengthFeatureChannelCountBatchSizeData(sequenceLength int, featureChannelCount int, batchSize int, data *TensorData) *Tensor
TensorWithSequenceLengthFeatureChannelCountBatchSizeData creates a tensor with the sequence length, number of feature channels, batch size, and data you specify.
func TensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType ¶ added in v0.17.0
func TensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType(sequenceLength int, featureChannelCount int, batchSize int, randomInitializerType RandomInitializerType) *Tensor
TensorWithSequenceLengthFeatureChannelCountBatchSizeRandomInitializerType creates a tensor with the sequence length, number of feature channels, batch size, and random initializer type you specify.
func TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData ¶ added in v0.17.0
func TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData(sequenceLengths []*foundation.Number, sortedSequences bool, featureChannelCount int, batchSize int, data *TensorData) *Tensor
TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeData creates a tensor with the sequence lengths, sorting indicator, number of feature channels, batch size, and data you specify.
func TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType ¶ added in v0.17.0
func TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType(sequenceLengths []*foundation.Number, sortedSequences bool, featureChannelCount int, batchSize int, randomInitializerType RandomInitializerType) *Tensor
TensorWithSequenceLengthsSortedSequencesFeatureChannelCountBatchSizeRandomInitializerType creates a tensor with the sequence lengths, sorting indicator, number of feature channels, batch size, and random initializer type you specify.
func TensorWithShape ¶ added in v0.17.0
func TensorWithShape(shape []*foundation.Number) *Tensor
TensorWithShape creates a tensor without data, with the shape you specify.
func TensorWithShapeDataDataType ¶ added in v0.17.0
func TensorWithShapeDataDataType(shape []*foundation.Number, data *TensorData, dataType DataType) *Tensor
TensorWithShapeDataDataType creates a tensor with the shape, data, and data type you specify.
func TensorWithShapeDataType ¶ added in v0.17.0
func TensorWithShapeDataType(shape []*foundation.Number, dataType DataType) *Tensor
TensorWithShapeDataType creates a tensor without data, with the shape and data type you specify.
func TensorWithShapeFillWithDataDataType ¶ added in v0.17.0
func TensorWithShapeFillWithDataDataType(shape []*foundation.Number, fillData obj.Object, dataType DataType) *Tensor
TensorWithShapeFillWithDataDataType creates a tensor with the shape, scalar value, and data type you specify.
func TensorWithShapeRandomInitializerType ¶ added in v0.17.0
func TensorWithShapeRandomInitializerType(shape []*foundation.Number, randomInitializerType RandomInitializerType) *Tensor
TensorWithShapeRandomInitializerType creates a tensor with the shape and random initializer type you specify.
func TensorWithShapeRandomInitializerTypeDataType ¶ added in v0.17.0
func TensorWithShapeRandomInitializerTypeDataType(shape []*foundation.Number, randomInitializerType RandomInitializerType, dataType DataType) *Tensor
TensorWithShapeRandomInitializerTypeDataType creates a tensor with the shape, random initializer, and data type you specify.
func TensorWithWidthHeightFeatureChannelCountBatchSize ¶ added in v0.17.0
func TensorWithWidthHeightFeatureChannelCountBatchSize(width int, height int, featureChannelCount int, batchSize int) *Tensor
TensorWithWidthHeightFeatureChannelCountBatchSize creates a tensor without data, with the sizes and number of feature channels you specify.
func TensorWithWidthHeightFeatureChannelCountBatchSizeData ¶ added in v0.17.0
func TensorWithWidthHeightFeatureChannelCountBatchSizeData(width int, height int, featureChannelCount int, batchSize int, data *TensorData) *Tensor
TensorWithWidthHeightFeatureChannelCountBatchSizeData creates a tensor with the sizes, number of feature channels, and data you specify.
func TensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType ¶ added in v0.17.0
func TensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType(width int, height int, featureChannelCount int, batchSize int, data *TensorData, dataType DataType) *Tensor
TensorWithWidthHeightFeatureChannelCountBatchSizeDataDataType creates a tensor with the sizes, number of feature channels, data, and data type you specify.
func TensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType ¶ added in v0.17.0
func TensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType(width int, height int, featureChannelCount int, batchSize int, fillData float32, dataType DataType) *Tensor
TensorWithWidthHeightFeatureChannelCountBatchSizeFillWithDataDataType creates a tensor with the sizes and number of feature channels, and filled with the data and type you specify.
func TensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType ¶ added in v0.17.0
func TensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType(width int, height int, featureChannelCount int, batchSize int, randomInitializerType RandomInitializerType) *Tensor
TensorWithWidthHeightFeatureChannelCountBatchSizeRandomInitializerType creates a tensor with the sizes, number of feature channels, and random data using the random initializer type you specify.
func (*Tensor) BindAndWriteDataToDevice ¶ added in v0.17.0
func (t *Tensor) BindAndWriteDataToDevice(data *TensorData, device *Device) bool
BindAndWriteDataToDevice associates the given data to the tensor, and if the device is a GPU, also copies the data to the device memory.
func (*Tensor) BindOptimizerDataDeviceData ¶ added in v0.17.0
func (t *Tensor) BindOptimizerDataDeviceData(data []*TensorData, deviceData []*TensorOptimizerDeviceData) bool
BindOptimizerDataDeviceData associates the optimizer and device data buffers you specify to the tensor.
func (*Tensor) CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice ¶ added in v0.17.0
func (t *Tensor) CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice(data unsafe.Pointer, length int, synchronizeWithDevice bool) bool
CopyDataFromDeviceMemoryToBytesLengthSynchronizeWithDevice copies tensor data from device memory to user-specified memory.
func (*Tensor) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Tensor) Descriptor ¶ added in v0.17.0
func (t *Tensor) Descriptor() *TensorDescriptor
Descriptor returns the tensor descriptor
func (*Tensor) HasValidNumerics ¶ added in v0.17.0
HasValidNumerics reports whether 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 (*Tensor) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Tensor) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Tensor) OptimizerData ¶ added in v0.17.0
func (t *Tensor) OptimizerData() []*TensorData
OptimizerData returns these are the host side optimizer (momentum and velocity) buffers which developers can query and initialize When customizing optimizer data, the contents of these buffers must be initialized before executing optimizer update for a graph.
OptimizerData returns the collection as a Go slice.
func (*Tensor) OptimizerDeviceData ¶ added in v0.17.0
func (t *Tensor) OptimizerDeviceData() []*TensorOptimizerDeviceData
OptimizerDeviceData returns these are the device side optimizer (momentum and velocity) buffers which developers can query
OptimizerDeviceData returns the collection as a Go slice.
func (*Tensor) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Tensor) SynchronizeData ¶ added in v0.17.0
SynchronizeData reports whether synchronizes the data in host memory.
func (*Tensor) SynchronizeOptimizerData ¶ added in v0.17.0
SynchronizeOptimizerData reports whether synchronizes the optimizer data in host memory.
func (*Tensor) TensorByDequantizingToTypeScaleBias ¶ added in v0.17.0
func (t *Tensor) TensorByDequantizingToTypeScaleBias(type_ DataType, scale *Tensor, bias *Tensor) *Tensor
TensorByDequantizingToTypeScaleBias converts a tensor you quantize to a 32-bit floating-point tensor.
func (*Tensor) TensorByDequantizingToTypeScaleBiasAxis ¶ added in v0.17.0
func (t *Tensor) TensorByDequantizingToTypeScaleBiasAxis(type_ DataType, scale *Tensor, bias *Tensor, axis int) *Tensor
TensorByDequantizingToTypeScaleBiasAxis converts a tensor you quantize to a 32-bit floating-point tensor.
func (*Tensor) TensorByQuantizingToTypeScaleBias ¶ added in v0.17.0
TensorByQuantizingToTypeScaleBias converts a 32-bit floating-point tensor with the scale and bias you specify.
func (*Tensor) TensorByQuantizingToTypeScaleBiasAxis ¶ added in v0.17.0
func (t *Tensor) TensorByQuantizingToTypeScaleBiasAxis(type_ DataType, scale *Tensor, bias *Tensor, axis int) *Tensor
TensorByQuantizingToTypeScaleBiasAxis converts a 32-bit floating-point tensor with the scale and bias you specify.
type TensorData ¶ added in v0.17.0
TensorData is an idiomatic wrapper over the Objective-C class MLCTensorData.
An encapsulation of the memory that tensor data uses.
func DataWithBytesNoCopyLength ¶ added in v0.17.0
func DataWithBytesNoCopyLength(data unsafe.Pointer, length int) *TensorData
DataWithBytesNoCopyLength creates a tensor data instance with the buffer of data and length of bytes you specify.
func DataWithBytesNoCopyLengthDeallocator ¶ added in v0.18.0
func DataWithBytesNoCopyLengthDeallocator(data unsafe.Pointer, length int, deallocator func(unsafe.Pointer, int)) *TensorData
DataWithBytesNoCopyLengthDeallocator creates a tensor data instance with a data buffer, byte length, and custom deallocator closure you specify.
func DataWithImmutableBytesNoCopyLength ¶ added in v0.17.0
func DataWithImmutableBytesNoCopyLength(data unsafe.Pointer, length int) *TensorData
DataWithImmutableBytesNoCopyLength creates a tensor data instance with the buffer of immutable data and length of bytes you specify.
func NewTensorData ¶ added in v0.17.0
func NewTensorData() *TensorData
NewTensorData creates a new TensorData.
func TensorDataFromID ¶ added in v0.17.0
func TensorDataFromID(id objc.ID) *TensorData
TensorDataFromID adopts an existing Objective-C object as a TensorData (nil for 0), retaining it and registering a release finalizer.
func (*TensorData) Bytes ¶ added in v0.18.0
func (td *TensorData) Bytes() unsafe.Pointer
Bytes returns pointer to memory that contains or will be used for tensor data
func (*TensorData) Description ¶ added in v0.17.0
func (td *TensorData) Description() string
Description returns the object's -description text.
func (*TensorData) IsEqual ¶ added in v0.17.0
func (td *TensorData) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*TensorData) IsKind ¶ added in v0.17.0
func (td *TensorData) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*TensorData) Length ¶ added in v0.17.0
func (td *TensorData) Length() int
Length returns the size in bytes of the tensor data
func (*TensorData) String ¶ added in v0.17.0
func (td *TensorData) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type TensorDescriptor ¶ added in v0.17.0
TensorDescriptor is an idiomatic wrapper over the Objective-C class MLCTensorDescriptor.
A configuration object you use to create a tensor.
func ConvolutionBiasesDescriptorWithFeatureChannelCountDataType ¶ added in v0.17.0
func ConvolutionBiasesDescriptorWithFeatureChannelCountDataType(featureChannelCount int, dataType DataType) *TensorDescriptor
ConvolutionBiasesDescriptorWithFeatureChannelCountDataType creates a tensor descriptor with the number of feature channels and data type you specify.
func ConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType ¶ added in v0.17.0
func ConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType(inputFeatureChannelCount int, outputFeatureChannelCount int, dataType DataType) *TensorDescriptor
ConvolutionWeightsDescriptorWithInputFeatureChannelCountOutputFeatureChannelCountDataType creates a tensor descriptor with the number of feature channels and data type you specify.
func ConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType ¶ added in v0.17.0
func ConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType(width int, height int, inputFeatureChannelCount int, outputFeatureChannelCount int, dataType DataType) *TensorDescriptor
ConvolutionWeightsDescriptorWithWidthHeightInputFeatureChannelCountOutputFeatureChannelCountDataType creates a tensor descriptor with the sizing, number of feature channels, and data type you specify.
func DescriptorWithShapeDataType ¶ added in v0.17.0
func DescriptorWithShapeDataType(shape []*foundation.Number, dataType DataType) *TensorDescriptor
DescriptorWithShapeDataType creates a tensor descriptor with the shape and data type you specify.
func DescriptorWithShapeSequenceLengthsSortedSequencesDataType ¶ added in v0.17.0
func DescriptorWithShapeSequenceLengthsSortedSequencesDataType(shape []*foundation.Number, sequenceLengths []*foundation.Number, sortedSequences bool, dataType DataType) *TensorDescriptor
DescriptorWithShapeSequenceLengthsSortedSequencesDataType creates a tensor descriptor with the shape, variable sequence lengths, sorting indicator, and data type you specify.
func DescriptorWithWidthHeightFeatureChannelCountBatchSize ¶ added in v0.17.0
func DescriptorWithWidthHeightFeatureChannelCountBatchSize(width int, height int, featureChannels int, batchSize int) *TensorDescriptor
DescriptorWithWidthHeightFeatureChannelCountBatchSize creates a tensor descriptor with the width and height, number of feature channels, and batch size you specify.
func DescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType ¶ added in v0.17.0
func DescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType(width int, height int, featureChannelCount int, batchSize int, dataType DataType) *TensorDescriptor
DescriptorWithWidthHeightFeatureChannelCountBatchSizeDataType creates a tensor descriptor with the width and height, number of feature channels, batch size, and data type you specify.
func NewTensorDescriptor ¶ added in v0.17.0
func NewTensorDescriptor() *TensorDescriptor
NewTensorDescriptor creates a new TensorDescriptor.
func TensorDescriptorFromID ¶ added in v0.17.0
func TensorDescriptorFromID(id objc.ID) *TensorDescriptor
TensorDescriptorFromID adopts an existing Objective-C object as a TensorDescriptor (nil for 0), retaining it and registering a release finalizer.
func (*TensorDescriptor) BatchSizePerSequenceStep ¶ added in v0.17.0
func (td *TensorDescriptor) BatchSizePerSequenceStep() []obj.Object
BatchSizePerSequenceStep returns the batch size for each sequence 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]).
BatchSizePerSequenceStep returns the collection as a Go slice.
func (*TensorDescriptor) DataType ¶ added in v0.17.0
func (td *TensorDescriptor) DataType() DataType
DataType returns the tensor data type. The default is MLCDataTypeFloat32.
func (*TensorDescriptor) Description ¶ added in v0.17.0
func (td *TensorDescriptor) Description() string
Description returns the object's -description text.
func (*TensorDescriptor) DimensionCount ¶ added in v0.17.0
func (td *TensorDescriptor) DimensionCount() int
DimensionCount returns the number of dimensions in the tensor
func (*TensorDescriptor) IsEqual ¶ added in v0.17.0
func (td *TensorDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*TensorDescriptor) IsKind ¶ added in v0.17.0
func (td *TensorDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*TensorDescriptor) SequenceLengths ¶ added in v0.17.0
func (td *TensorDescriptor) SequenceLengths() []obj.Object
SequenceLengths returns TODO
SequenceLengths returns the collection as a Go slice.
func (*TensorDescriptor) Shape ¶ added in v0.17.0
func (td *TensorDescriptor) Shape() []obj.Object
Shape returns the size in each dimension
Shape returns the collection as a Go slice.
func (*TensorDescriptor) SortedSequences ¶ added in v0.17.0
func (td *TensorDescriptor) SortedSequences() bool
SortedSequences reports whether the sequences are sorted or not.
func (*TensorDescriptor) Stride ¶ added in v0.17.0
func (td *TensorDescriptor) Stride() []obj.Object
Stride returns the stride in bytes in each dimension
Stride returns the collection as a Go slice.
func (*TensorDescriptor) String ¶ added in v0.17.0
func (td *TensorDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*TensorDescriptor) TensorAllocationSizeInBytes ¶ added in v0.17.0
func (td *TensorDescriptor) TensorAllocationSizeInBytes() int
TensorAllocationSizeInBytes returns the allocation size in bytes for a tensor.
type TensorOptimizerDeviceData ¶ added in v0.17.0
TensorOptimizerDeviceData is an idiomatic wrapper over the Objective-C class MLCTensorOptimizerDeviceData.
An encapsulation of the device memory associated with a tensor that an optimizer uses.
func NewTensorOptimizerDeviceData ¶ added in v0.17.0
func NewTensorOptimizerDeviceData() *TensorOptimizerDeviceData
NewTensorOptimizerDeviceData creates a new TensorOptimizerDeviceData.
func TensorOptimizerDeviceDataFromID ¶ added in v0.17.0
func TensorOptimizerDeviceDataFromID(id objc.ID) *TensorOptimizerDeviceData
TensorOptimizerDeviceDataFromID adopts an existing Objective-C object as a TensorOptimizerDeviceData (nil for 0), retaining it and registering a release finalizer.
func (*TensorOptimizerDeviceData) Description ¶ added in v0.17.0
func (todd *TensorOptimizerDeviceData) Description() string
Description returns the object's -description text.
func (*TensorOptimizerDeviceData) IsEqual ¶ added in v0.17.0
func (todd *TensorOptimizerDeviceData) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*TensorOptimizerDeviceData) IsKind ¶ added in v0.17.0
func (todd *TensorOptimizerDeviceData) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*TensorOptimizerDeviceData) String ¶ added in v0.17.0
func (todd *TensorOptimizerDeviceData) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type TensorParameter ¶ added in v0.17.0
TensorParameter is an idiomatic wrapper over the Objective-C class MLCTensorParameter.
A tensor parameter object.
func NewTensorParameter ¶ added in v0.17.0
func NewTensorParameter() *TensorParameter
NewTensorParameter creates a new TensorParameter.
func ParameterWithTensor ¶ added in v0.17.0
func ParameterWithTensor(tensor *Tensor) *TensorParameter
ParameterWithTensor creates a tensor parameter with the tensor you specify.
func ParameterWithTensorOptimizerData ¶ added in v0.17.0
func ParameterWithTensorOptimizerData(tensor *Tensor, optimizerData []*TensorData) *TensorParameter
ParameterWithTensorOptimizerData creates a tensor parameter with the tensor and optimizer data you specify.
func TensorParameterFromID ¶ added in v0.17.0
func TensorParameterFromID(id objc.ID) *TensorParameter
TensorParameterFromID adopts an existing Objective-C object as a TensorParameter (nil for 0), retaining it and registering a release finalizer.
func (*TensorParameter) Description ¶ added in v0.17.0
func (tp *TensorParameter) Description() string
Description returns the object's -description text.
func (*TensorParameter) IsEqual ¶ added in v0.17.0
func (tp *TensorParameter) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*TensorParameter) IsKind ¶ added in v0.17.0
func (tp *TensorParameter) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*TensorParameter) IsUpdatable ¶ added in v0.17.0
func (tp *TensorParameter) IsUpdatable() bool
IsUpdatable reports whether this tensor parameter is updatable
func (*TensorParameter) String ¶ added in v0.17.0
func (tp *TensorParameter) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*TensorParameter) Tensor ¶ added in v0.17.0
func (tp *TensorParameter) Tensor() *Tensor
Tensor returns the underlying tensor
func (*TensorParameter) WithIsUpdatable ¶ added in v0.17.0
func (tp *TensorParameter) WithIsUpdatable(isUpdatable bool) *TensorParameter
WithIsUpdatable sets a Boolean that indicates whether this tensor parameter is updatable.
type TrainingGraph ¶ added in v0.17.0
type TrainingGraph struct {
Graph
}
TrainingGraph is an idiomatic wrapper over the Objective-C class MLCTrainingGraph.
It embeds Graph, promoting that type's methods.
A training graph that you create from one or more graph objects plus additional layers you add directly to the training graph.
func GraphWithGraphObjectsLossLayerOptimizer ¶ added in v0.17.0
func GraphWithGraphObjectsLossLayerOptimizer(graphObjects []*Graph, lossLayer *Layer, optimizer *Optimizer) *TrainingGraph
GraphWithGraphObjectsLossLayerOptimizer creates a training graph with the layers from the graph objects, loss layer, and optimizer you specify.
func NewTrainingGraph ¶ added in v0.17.0
func NewTrainingGraph() *TrainingGraph
NewTrainingGraph creates a new TrainingGraph.
func TrainingGraphFromID ¶ added in v0.17.0
func TrainingGraphFromID(id objc.ID) *TrainingGraph
TrainingGraphFromID adopts an existing Objective-C object as a TrainingGraph (nil for 0), retaining it and registering a release finalizer.
func (*TrainingGraph) AddInputsLossLabels ¶ added in v0.17.0
func (tg *TrainingGraph) AddInputsLossLabels(inputs map[string]*Tensor, lossLabels map[string]*Tensor) bool
AddInputsLossLabels adds the inputs and loss label inputs that you specify to the training graph.
func (*TrainingGraph) AddInputsLossLabelsLossLabelWeights ¶ added in v0.17.0
func (tg *TrainingGraph) AddInputsLossLabelsLossLabelWeights(inputs map[string]*Tensor, lossLabels map[string]*Tensor, lossLabelWeights map[string]*Tensor) bool
AddInputsLossLabelsLossLabelWeights adds the inputs, loss labels, and loss label weights that you specify to the training graph.
func (*TrainingGraph) AddOutputs ¶ added in v0.17.0
func (tg *TrainingGraph) AddOutputs(outputs map[string]*Tensor) bool
AddOutputs adds the outputs to the training graph you specify.
func (*TrainingGraph) AllocateUserGradientForTensor ¶ added in v0.17.0
func (tg *TrainingGraph) AllocateUserGradientForTensor(tensor *Tensor) *Tensor
AllocateUserGradientForTensor allocates an entry for a gradient for the result tensor you specify.
func (*TrainingGraph) BindOptimizerDataDeviceDataWithTensor ¶ added in v0.17.0
func (tg *TrainingGraph) BindOptimizerDataDeviceDataWithTensor(data []*TensorData, deviceData []*TensorOptimizerDeviceData, tensor *Tensor) bool
BindOptimizerDataDeviceDataWithTensor associates the optimizer and device data you specify along with the tensor.
func (*TrainingGraph) CompileOptimizer ¶ added in v0.17.0
func (tg *TrainingGraph) CompileOptimizer(optimizer *Optimizer) bool
CompileOptimizer compiles the optimizer to use with a training graph you specify.
func (*TrainingGraph) CompileWithOptionsDevice ¶ added in v0.17.0
func (tg *TrainingGraph) CompileWithOptionsDevice(options GraphCompilationOptions, device *Device) bool
CompileWithOptionsDevice compiles the training graph for the options and device you specify.
func (*TrainingGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData ¶ added in v0.17.0
func (tg *TrainingGraph) CompileWithOptionsDeviceInputTensorsInputTensorsData(options GraphCompilationOptions, device *Device, inputTensors map[string]*Tensor, inputTensorsData map[string]*TensorData) bool
CompileWithOptionsDeviceInputTensorsInputTensorsData compiles the training graph for the options, device, and input tensors you specify.
func (*TrainingGraph) DeviceMemorySize ¶ added in v0.17.0
func (tg *TrainingGraph) DeviceMemorySize() int
DeviceMemorySize 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.
func (*TrainingGraph) ExecuteForwardWithBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteForwardWithBatchSizeOptionsCompletionHandler(batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteForwardWithBatchSizeOptionsCompletionHandler executes the forward pass of the training graph with the batch size, execution options, and completion handler you specify.
func (*TrainingGraph) ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize int, options ExecutionOptions, outputsData map[string]*TensorData, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteForwardWithBatchSizeOptionsOutputsDataCompletionHandler executes the forward pass of the training graph with the batch size, execution options, output data, and completion handler you specify.
func (*TrainingGraph) ExecuteGradientWithBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteGradientWithBatchSizeOptionsCompletionHandler(batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteGradientWithBatchSizeOptionsCompletionHandler executes the gradient pass of the training graph with the batch size, execution options, and completion handler you specify.
func (*TrainingGraph) ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler(batchSize int, options ExecutionOptions, outputsData map[string]*TensorData, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteGradientWithBatchSizeOptionsOutputsDataCompletionHandler executes the gradient pass of the training graph with the batch size, execution options, output data, and completion handler you specify.
func (*TrainingGraph) ExecuteOptimizerUpdateWithOptionsCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteOptimizerUpdateWithOptionsCompletionHandler(options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteOptimizerUpdateWithOptionsCompletionHandler executes the optimizer update pass of the training graph with the execution options and completion handler you specify.
func (*TrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, lossLabelWeightsData map[string]*TensorData, batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataBatchSizeOptionsCompletionHandler executes the training graph with the input data, batch size, execution options, and completion handler you specify.
func (*TrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler ¶ added in v0.18.0
func (tg *TrainingGraph) ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler(inputsData map[string]*TensorData, lossLabelsData map[string]*TensorData, lossLabelWeightsData map[string]*TensorData, outputsData map[string]*TensorData, batchSize int, options ExecutionOptions, completionHandler func(obj.Object, unsafe.Pointer, float64)) bool
ExecuteWithInputsDataLossLabelsDataLossLabelWeightsDataOutputsDataBatchSizeOptionsCompletionHandler executes the training graph with the input data, output data, batch size, execution options, and completion handler that you specify.
func (*TrainingGraph) GradientDataForParameterLayer ¶ added in v0.17.0
func (tg *TrainingGraph) GradientDataForParameterLayer(parameter *Tensor, layer *Layer) []byte
GradientDataForParameterLayer gets the gradient data for the trainable parameter and associated layer you specify.
func (*TrainingGraph) GradientTensorForInput ¶ added in v0.17.0
func (tg *TrainingGraph) GradientTensorForInput(input *Tensor) *Tensor
GradientTensorForInput gets the gradient tensor for the input tensor you specify.
func (*TrainingGraph) LinkWithGraphs ¶ added in v0.17.0
func (tg *TrainingGraph) LinkWithGraphs(graphs []*TrainingGraph) bool
LinkWithGraphs links the training graphs you specify.
func (*TrainingGraph) Optimizer ¶ added in v0.17.0
func (tg *TrainingGraph) Optimizer() *Optimizer
Optimizer returns the optimizer to be used with the training graph
func (*TrainingGraph) ResultGradientTensorsForLayer ¶ added in v0.17.0
func (tg *TrainingGraph) ResultGradientTensorsForLayer(layer *Layer) []*Tensor
ResultGradientTensorsForLayer gets the result gradient tensors for the layer in the training graph you specify.
func (*TrainingGraph) SetTrainingTensorParameters ¶ added in v0.17.0
func (tg *TrainingGraph) SetTrainingTensorParameters(parameters []*TensorParameter) bool
SetTrainingTensorParameters sets the input tensor parameters, which the optimizer then updates.
func (*TrainingGraph) SourceGradientTensorsForLayer ¶ added in v0.17.0
func (tg *TrainingGraph) SourceGradientTensorsForLayer(layer *Layer) []*Tensor
SourceGradientTensorsForLayer gets the source gradient tensors for the layer in the training graph you specify.
func (*TrainingGraph) StopGradientForTensors ¶ added in v0.17.0
func (tg *TrainingGraph) StopGradientForTensors(tensors []*Tensor) bool
StopGradientForTensors adds the tensors that you specify, to indicate which contributions the graph excludes when computing gradients during gradient pass.
func (*TrainingGraph) SynchronizeUpdates ¶ added in v0.17.0
func (tg *TrainingGraph) SynchronizeUpdates()
SynchronizeUpdates synchronizes updates from device memory.
type TransposeLayer ¶ added in v0.17.0
type TransposeLayer struct {
Layer
}
TransposeLayer is an idiomatic wrapper over the Objective-C class MLCTransposeLayer.
It embeds Layer, promoting that type's methods.
A layer that permutes the dimensions you specify.
func LayerWithDimensions ¶ added in v0.17.0
func LayerWithDimensions(dimensions []*foundation.Number) *TransposeLayer
LayerWithDimensions creates a transpose layer with the dimensions you specify.
func NewTransposeLayer ¶ added in v0.17.0
func NewTransposeLayer() *TransposeLayer
NewTransposeLayer creates a new TransposeLayer.
func TransposeLayerFromID ¶ added in v0.17.0
func TransposeLayerFromID(id objc.ID) *TransposeLayer
TransposeLayerFromID adopts an existing Objective-C object as a TransposeLayer (nil for 0), retaining it and registering a release finalizer.
func (*TransposeLayer) Dimensions ¶ added in v0.17.0
func (tl *TransposeLayer) Dimensions() []obj.Object
Dimensions returns permutes the dimensions according to 'dimensions'. The returned tensor's dimension i will correspond to dimensions[i].
Dimensions returns the collection as a Go slice.
func (*TransposeLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (tl *TransposeLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *TransposeLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*TransposeLayer) WithLabel ¶ added in v0.17.0
func (tl *TransposeLayer) WithLabel(label string) *TransposeLayer
WithLabel sets a string that helps identify this layer.
type UpsampleLayer ¶ added in v0.17.0
type UpsampleLayer struct {
Layer
}
UpsampleLayer is an idiomatic wrapper over the Objective-C class MLCUpsampleLayer.
It embeds Layer, promoting that type's methods.
A layer that applies upsampling with the shape you specify.
func LayerWithShapeSampleModeAlignsCorners ¶ added in v0.17.0
func LayerWithShapeSampleModeAlignsCorners(shape []*foundation.Number, sampleMode SampleMode, alignsCorners bool) *UpsampleLayer
LayerWithShapeSampleModeAlignsCorners creates an upsample layer with the shape, upsampling algorithm, and corner alignement option you specify.
func MLCUpsampleLayerLayerWithShape ¶
func MLCUpsampleLayerLayerWithShape(shape []*foundation.Number) *UpsampleLayer
MLCUpsampleLayerLayerWithShape creates an upsample layer with the shape you specify.
func NewUpsampleLayer ¶ added in v0.17.0
func NewUpsampleLayer() *UpsampleLayer
NewUpsampleLayer creates a new UpsampleLayer.
func UpsampleLayerFromID ¶ added in v0.17.0
func UpsampleLayerFromID(id objc.ID) *UpsampleLayer
UpsampleLayerFromID adopts an existing Objective-C object as a UpsampleLayer (nil for 0), retaining it and registering a release finalizer.
func (*UpsampleLayer) AlignsCorners ¶ added in v0.17.0
func (ul *UpsampleLayer) AlignsCorners() bool
AlignsCorners reports whether a boolean that specifies whether the corner pixels of the source and result tensors are aligned. 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 false.
func (*UpsampleLayer) SampleMode ¶ added in v0.17.0
func (ul *UpsampleLayer) SampleMode() SampleMode
SampleMode returns the sampling mode to use when performing the upsample.
func (*UpsampleLayer) Shape ¶ added in v0.17.0
func (ul *UpsampleLayer) Shape() []obj.Object
Shape returns 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.
Shape returns the collection as a Go slice.
func (*UpsampleLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (ul *UpsampleLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *UpsampleLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*UpsampleLayer) WithLabel ¶ added in v0.17.0
func (ul *UpsampleLayer) WithLabel(label string) *UpsampleLayer
WithLabel sets a string that helps identify this layer.
type VirtualMemoryGuardExceptionCode ¶ added in v0.17.0
type VirtualMemoryGuardExceptionCode uint32
const ( KGUARD_EXC_DEALLOC_GAP VirtualMemoryGuardExceptionCode = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE VirtualMemoryGuardExceptionCode = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE VirtualMemoryGuardExceptionCode = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE VirtualMemoryGuardExceptionCode = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE VirtualMemoryGuardExceptionCode = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE VirtualMemoryGuardExceptionCode = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE VirtualMemoryGuardExceptionCode = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION VirtualMemoryGuardExceptionCode = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY VirtualMemoryGuardExceptionCode = 13 KGUARD_EXC_SEC_ACCESS_FAULT VirtualMemoryGuardExceptionCode = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT VirtualMemoryGuardExceptionCode = 99 KGUARD_EXC_SEC_COPY_DENIED VirtualMemoryGuardExceptionCode = 100 KGUARD_EXC_SEC_SHARING_DENIED VirtualMemoryGuardExceptionCode = 101 KGUARD_EXC_MTE_SYNC_FAULT VirtualMemoryGuardExceptionCode = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 204 )
func (VirtualMemoryGuardExceptionCode) String ¶ added in v0.17.0
func (e VirtualMemoryGuardExceptionCode) String() string
String returns the VirtualMemoryGuardExceptionCode constant's name, or its numeric form when the value is not a known constant.
type XpcListenerCreateFlags ¶ added in v0.17.0
type XpcListenerCreateFlags uint64
Bitmask — values may be combined with |.
const ( XpcListenerCreateFlagsNone XpcListenerCreateFlags = 0 XpcListenerCreateFlagsInactive XpcListenerCreateFlags = 1 XpcListenerCreateFlagsForceMach XpcListenerCreateFlags = 2 XpcListenerCreateFlagsForceXpcservice XpcListenerCreateFlags = 4 )
func (XpcListenerCreateFlags) String ¶ added in v0.17.0
func (e XpcListenerCreateFlags) String() string
String returns the XpcListenerCreateFlags constant's name, or its numeric form when the value is not a known constant.
type XpcSessionCreateFlags ¶ added in v0.17.0
type XpcSessionCreateFlags uint64
Bitmask — values may be combined with |.
const ( XpcSessionCreateFlagsNone XpcSessionCreateFlags = 0 XpcSessionCreateFlagsInactive XpcSessionCreateFlags = 1 XpcSessionCreateFlagsMachPrivileged XpcSessionCreateFlags = 2 )
func (XpcSessionCreateFlags) String ¶ added in v0.17.0
func (e XpcSessionCreateFlags) String() string
String returns the XpcSessionCreateFlags constant's name, or its numeric form when the value is not a known constant.
type YOLOLossDescriptor ¶ added in v0.17.0
YOLOLossDescriptor is an idiomatic wrapper over the Objective-C class MLCYOLOLossDescriptor.
The configuration object you use to create the YOLO loss layer.
func DescriptorWithAnchorBoxesAnchorBoxCount ¶ added in v0.17.0
func DescriptorWithAnchorBoxesAnchorBoxCount(anchorBoxes []byte, anchorBoxCount int) *YOLOLossDescriptor
DescriptorWithAnchorBoxesAnchorBoxCount creates a YOLO loss filter descriptor with the anchor box data and number of anchor boxes you specify.
func NewYOLOLossDescriptor ¶ added in v0.17.0
func NewYOLOLossDescriptor() *YOLOLossDescriptor
NewYOLOLossDescriptor creates a new YOLOLossDescriptor.
func YOLOLossDescriptorFromID ¶ added in v0.17.0
func YOLOLossDescriptorFromID(id objc.ID) *YOLOLossDescriptor
YOLOLossDescriptorFromID adopts an existing Objective-C object as a YOLOLossDescriptor (nil for 0), retaining it and registering a release finalizer.
func (*YOLOLossDescriptor) AnchorBoxCount ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) AnchorBoxCount() int
AnchorBoxCount returns number of anchor boxes used to detect object per grid cell
func (*YOLOLossDescriptor) AnchorBoxes ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) AnchorBoxes() []byte
AnchorBoxes returns \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 (*YOLOLossDescriptor) Description ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) Description() string
Description returns the object's -description text.
func (*YOLOLossDescriptor) IsEqual ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*YOLOLossDescriptor) IsKind ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*YOLOLossDescriptor) MaximumIOUForObjectAbsence ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) MaximumIOUForObjectAbsence() float32
MaximumIOUForObjectAbsence returns if the prediction IOU with groundTruth is lower than this value we consider it a confident object absence. The default is 0.3
func (*YOLOLossDescriptor) MinimumIOUForObjectPresence ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) MinimumIOUForObjectPresence() float32
MinimumIOUForObjectPresence returns if the prediction IOU with groundTruth is higher than this value we consider it a confident object presence, The default is 0.7
func (*YOLOLossDescriptor) ScaleClassLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) ScaleClassLoss() float32
ScaleClassLoss returns the scale factor for no object classes loss and loss gradient. The default is 2.0
func (*YOLOLossDescriptor) ScaleNoObjectConfidenceLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) ScaleNoObjectConfidenceLoss() float32
ScaleNoObjectConfidenceLoss returns the scale factor for no object confidence loss and loss gradient. The default is 5.0
func (*YOLOLossDescriptor) ScaleObjectConfidenceLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) ScaleObjectConfidenceLoss() float32
ScaleObjectConfidenceLoss returns the scale factor for object confidence loss and loss gradient. The default is 100.0
func (*YOLOLossDescriptor) ScaleSpatialPositionLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) ScaleSpatialPositionLoss() float32
ScaleSpatialPositionLoss returns the scale factor for spatial position loss and loss gradient. The default is 10.0
func (*YOLOLossDescriptor) ScaleSpatialSizeLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) ScaleSpatialSizeLoss() float32
ScaleSpatialSizeLoss returns the scale factor for spatial size loss and loss gradient. The default is 10.0
func (*YOLOLossDescriptor) ShouldRescore ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) ShouldRescore() bool
ShouldRescore reports whether rescore pertains to multiplying the confidence groundTruth with IOU (intersection over union) of predicted bounding box and the groundTruth boundingBox. The default is true
func (*YOLOLossDescriptor) String ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*YOLOLossDescriptor) WithMaximumIOUForObjectAbsence ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithMaximumIOUForObjectAbsence(maximumIOUForObjectAbsence float32) *YOLOLossDescriptor
WithMaximumIOUForObjectAbsence sets the negative intersection over union (IOU).
func (*YOLOLossDescriptor) WithMinimumIOUForObjectPresence ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithMinimumIOUForObjectPresence(minimumIOUForObjectPresence float32) *YOLOLossDescriptor
WithMinimumIOUForObjectPresence sets the positive intersection over union (IOU).
func (*YOLOLossDescriptor) WithScaleClassLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithScaleClassLoss(scaleClassLoss float32) *YOLOLossDescriptor
WithScaleClassLoss sets the scale factor you use for loss when there are no object classes, and for loss gradient.
func (*YOLOLossDescriptor) WithScaleNoObjectConfidenceLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithScaleNoObjectConfidenceLoss(scaleNoObjectConfidenceLoss float32) *YOLOLossDescriptor
WithScaleNoObjectConfidenceLoss sets the scale factor you use for no object confidence loss and loss gradient.
func (*YOLOLossDescriptor) WithScaleObjectConfidenceLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithScaleObjectConfidenceLoss(scaleObjectConfidenceLoss float32) *YOLOLossDescriptor
WithScaleObjectConfidenceLoss sets the scale factor you use for object confidence loss and loss gradient.
func (*YOLOLossDescriptor) WithScaleSpatialPositionLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithScaleSpatialPositionLoss(scaleSpatialPositionLoss float32) *YOLOLossDescriptor
WithScaleSpatialPositionLoss sets the scale factor you use for spatial position loss and loss gradient.
func (*YOLOLossDescriptor) WithScaleSpatialSizeLoss ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithScaleSpatialSizeLoss(scaleSpatialSizeLoss float32) *YOLOLossDescriptor
WithScaleSpatialSizeLoss sets the scale factor you use for spatial size loss and loss gradient.
func (*YOLOLossDescriptor) WithShouldRescore ¶ added in v0.17.0
func (yld *YOLOLossDescriptor) WithShouldRescore(shouldRescore bool) *YOLOLossDescriptor
WithShouldRescore sets a Boolean that indicates whether the layer scales the object confidence loss by the intersection over union (IOU) overlap.
type YOLOLossLayer ¶ added in v0.17.0
type YOLOLossLayer struct {
LossLayer
}
YOLOLossLayer is an idiomatic wrapper over the Objective-C class MLCYOLOLossLayer.
It embeds LossLayer, promoting that type's methods.
A layer that estimates loss for the YOLO algorithm.
func MLCYOLOLossLayerLayerWithDescriptor ¶
func MLCYOLOLossLayerLayerWithDescriptor(lossDescriptor *YOLOLossDescriptor) *YOLOLossLayer
MLCYOLOLossLayerLayerWithDescriptor creates a YOLO loss layer with the descriptor you specify.
func NewYOLOLossLayer ¶ added in v0.17.0
func NewYOLOLossLayer() *YOLOLossLayer
NewYOLOLossLayer creates a new YOLOLossLayer.
func YOLOLossLayerFromID ¶ added in v0.17.0
func YOLOLossLayerFromID(id objc.ID) *YOLOLossLayer
YOLOLossLayerFromID adopts an existing Objective-C object as a YOLOLossLayer (nil for 0), retaining it and registering a release finalizer.
func (*YOLOLossLayer) WithIsDebuggingEnabled ¶ added in v0.17.0
func (yll *YOLOLossLayer) WithIsDebuggingEnabled(isDebuggingEnabled bool) *YOLOLossLayer
WithIsDebuggingEnabled sets a Boolean that indicates whether you choose to debug the layer when executing a graph that includes it.
func (*YOLOLossLayer) WithLabel ¶ added in v0.17.0
func (yll *YOLOLossLayer) WithLabel(label string) *YOLOLossLayer
WithLabel sets a string that helps identify this layer.
func (*YOLOLossLayer) YoloLossDescriptor ¶ added in v0.17.0
func (yll *YOLOLossLayer) YoloLossDescriptor() *YOLOLossDescriptor
YoloLossDescriptor returns the YOLO loss descriptor
Source Files
¶
- MLCActivationDescriptor_generated.go
- MLCActivationLayer_generated.go
- MLCAdamOptimizer_generated.go
- MLCAdamWOptimizer_generated.go
- MLCArithmeticLayer_generated.go
- MLCBatchNormalizationLayer_generated.go
- MLCComparisonLayer_generated.go
- MLCConcatenationLayer_generated.go
- MLCConvolutionDescriptor_generated.go
- MLCConvolutionLayer_generated.go
- MLCDevice_generated.go
- MLCDropoutLayer_generated.go
- MLCEmbeddingDescriptor_generated.go
- MLCEmbeddingLayer_generated.go
- MLCFullyConnectedLayer_generated.go
- MLCGatherLayer_generated.go
- MLCGramMatrixLayer_generated.go
- MLCGraph_generated.go
- MLCGroupNormalizationLayer_generated.go
- MLCInferenceGraph_generated.go
- MLCInstanceNormalizationLayer_generated.go
- MLCLSTMDescriptor_generated.go
- MLCLSTMLayer_generated.go
- MLCLayerNormalizationLayer_generated.go
- MLCLayer_generated.go
- MLCLossDescriptor_generated.go
- MLCLossLayer_generated.go
- MLCMatMulDescriptor_generated.go
- MLCMatMulLayer_generated.go
- MLCMultiheadAttentionDescriptor_generated.go
- MLCMultiheadAttentionLayer_generated.go
- MLCOptimizerDescriptor_generated.go
- MLCOptimizer_generated.go
- MLCPaddingLayer_generated.go
- MLCPlatform_generated.go
- MLCPoolingDescriptor_generated.go
- MLCPoolingLayer_generated.go
- MLCRMSPropOptimizer_generated.go
- MLCReductionLayer_generated.go
- MLCReshapeLayer_generated.go
- MLCSGDOptimizer_generated.go
- MLCScatterLayer_generated.go
- MLCSelectionLayer_generated.go
- MLCSliceLayer_generated.go
- MLCSoftmaxLayer_generated.go
- MLCSplitLayer_generated.go
- MLCTensorData_generated.go
- MLCTensorDescriptor_generated.go
- MLCTensorOptimizerDeviceData_generated.go
- MLCTensorParameter_generated.go
- MLCTensor_generated.go
- MLCTrainingGraph_generated.go
- MLCTransposeLayer_generated.go
- MLCUpsampleLayer_generated.go
- MLCYOLOLossDescriptor_generated.go
- MLCYOLOLossLayer_generated.go
- doc.go
- mlcompute_cfunctions_generated.go
- mlcompute_classmethods_generated.go
- mlcompute_enums_generated.go
- mlcompute_providers_generated.go
- mlcompute_runtime_generated.go