public interface MPSCNNBatchNormalizationDataSource extends NSCopying
The MPSCNNBatchNormalizationDataSource protocol declares the methods that an instance of MPSCNNBatchNormalizationState uses to initialize the scale factors, bias terms, and batch statistics.
| Modifier and Type | Method and Description |
|---|---|
default boolean |
_supportsSecureCoding()
NSSecureCoding compatibility.
|
org.moe.natj.general.ptr.FloatPtr |
beta()
Returns a pointer to the bias terms for the batch normalization.
|
default MPSCNNBatchNormalizationDataSource |
copyWithZoneDevice(org.moe.natj.general.ptr.VoidPtr zone,
MTLDevice device)
Optional copy method to create a copy of the data source for use with a new device.
|
default void |
encodeWithCoder(NSCoder aCoder)
NSSecureCoding compatibility.
|
default float |
epsilon()
An optional tiny number to use to maintain numerical stability.
|
org.moe.natj.general.ptr.FloatPtr |
gamma()
Returns a pointer to the scale factors for the batch normalization.
|
default MPSCNNBatchNormalizationDataSource |
initWithCoder(NSCoder aDecoder)
NSSecureCoding compatibility.
|
java.lang.String |
label()
A label that is transferred to the batch normalization filter at init time
|
boolean |
load_objc()
Alerts the data source that the data will be needed soon
|
org.moe.natj.general.ptr.FloatPtr |
mean()
Returns a pointer to batch mean values with which to initialize
the state for a subsequent batch normalization.
|
long |
numberOfFeatureChannels()
Returns the number of feature channels within images to be normalized
using the supplied parameters.
|
void |
purge()
Alerts the data source that the data is no longer needed
|
default boolean |
updateGammaAndBetaWithBatchNormalizationState(MPSCNNBatchNormalizationState batchNormalizationState)
Compute new gamma and beta values using current values and gradients contained within a
MPSCNNBatchNormalizationState.
|
default MPSCNNNormalizationGammaAndBetaState |
updateGammaAndBetaWithCommandBufferBatchNormalizationState(MTLCommandBuffer commandBuffer,
MPSCNNBatchNormalizationState batchNormalizationState)
Compute new gamma and beta values using current values and gradients contained within a
MPSCNNBatchNormalizationState.
|
default boolean |
updateMeanAndVarianceWithBatchNormalizationState(MPSCNNBatchNormalizationState batchNormalizationState)
Compute new mean and variance values using current batch statistics contained within a
MPSCNNBatchNormalizationState.
|
default MPSCNNNormalizationMeanAndVarianceState |
updateMeanAndVarianceWithCommandBufferBatchNormalizationState(MTLCommandBuffer commandBuffer,
MPSCNNBatchNormalizationState batchNormalizationState)
Compute new mean and variance values using current batch statistics contained within a
MPSCNNBatchNormalizationState.
|
org.moe.natj.general.ptr.FloatPtr |
variance()
Returns a pointer to batch variance values with which to initialize
the state for a subsequent batch normalization.
|
copyWithZoneorg.moe.natj.general.ptr.FloatPtr beta()
default MPSCNNBatchNormalizationDataSource copyWithZoneDevice(org.moe.natj.general.ptr.VoidPtr zone, MTLDevice device)
zone - The NSZone on which to allocate.device - The device where the kernel which uses this data source will be used.default void encodeWithCoder(NSCoder aCoder)
default float epsilon()
output_image = (input_image - mean[c]) * gamma[c] / sqrt(variance[c] + epsilon) + beta[c]; Defalt value if method unavailable: FLT_MIN
org.moe.natj.general.ptr.FloatPtr gamma()
default MPSCNNBatchNormalizationDataSource initWithCoder(NSCoder aDecoder)
java.lang.String label()
Overridden by a MPSCNNBatchNormalizationNode.label if it is non-nil.
boolean load_objc()
Each load alert will be balanced by a purge later, when MPS no longer needs the data from this object. Load will always be called atleast once after initial construction or each purge of the object before anything else is called.
org.moe.natj.general.ptr.FloatPtr mean()
long numberOfFeatureChannels()
void purge()
Each load alert will be balanced by a purge later, when MPS no longer needs the data from this object.
default boolean _supportsSecureCoding()
default boolean updateGammaAndBetaWithBatchNormalizationState(MPSCNNBatchNormalizationState batchNormalizationState)
batchNormalizationState - The MPSCNNBatchNormalizationState object containing the current gamma and
beta values and the gradient values.default MPSCNNNormalizationGammaAndBetaState updateGammaAndBetaWithCommandBufferBatchNormalizationState(MTLCommandBuffer commandBuffer, MPSCNNBatchNormalizationState batchNormalizationState)
This operation is expected to also decrement the read count of batchNormalizationState by 1.
commandBuffer - The command buffer on which to encode the update.batchNormalizationState - The MPSCNNBatchNormalizationState object containing the current gamma and
beta values and the gradient values.default boolean updateMeanAndVarianceWithBatchNormalizationState(MPSCNNBatchNormalizationState batchNormalizationState)
batchNormalizationState - The MPSCNNBatchNormalizationState object containing the current batch statistics.default MPSCNNNormalizationMeanAndVarianceState updateMeanAndVarianceWithCommandBufferBatchNormalizationState(MTLCommandBuffer commandBuffer, MPSCNNBatchNormalizationState batchNormalizationState)
This operation is expected to also decrement the read count of batchNormalizationState by 1.
commandBuffer - The command buffer on which to encode the update.batchNormalizationState - The MPSCNNBatchNormalizationState object containing the current batch statistics.org.moe.natj.general.ptr.FloatPtr variance()