Class CROperatorGridBilinearWeights
- All Implemented Interfaces:
CROperatorBackwardsJac<double[]>, CROperatorForward<double[]>
Turns a pixel into the 4 bilinear weights of the cell it lands in, ready to be blended by
CROperatorBilinearPolyND. This is the half that knows how an image maps onto a grid.
The cell is worked out from the pixel. Whatever needs to fetch the matching knots reads it back through
col and row, which is what the pre-forward hook does. A pixel outside the grid is not an error: the
cell clamps to the nearest real one, the fractions leave [0,1], and the weights extrapolate.
The knots are ordered (col,row), (col+1,row), (col,row+1), (col+1,row+1)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigure(int width, int height, ConfigGridCoefND grid) voidPerforms forward pass of the function.Class<double[]> Primitive data type for the arrayintNumber of inputsintgetInputSize(int which) Returns the specified input's vector sizeintReturns the output vector's sizeRetrieve a serialized description of the settingsvoidThe cell is fixed, so a weight only moves through the fractions, and those are linear in the pixelvoidSpecifies the value of an input's vector.voidsetSettings(Map<String, String> settings) Reconfigures the block using the specified settingsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CROperatorForward
normalizeAfterStep
-
Field Details
-
IN_PIXEL
public static final int IN_PIXEL- See Also:
-
-
Constructor Details
-
CROperatorGridBilinearWeights
public CROperatorGridBilinearWeights()
-
-
Method Details
-
configure
-
forward
Description copied from interface:CROperatorForwardPerforms forward pass of the function. Must have already updatedCROperatorForward.setInput(int, CRArray).- Specified by:
forwardin interfaceCROperatorForward<double[]>- Parameters:
output- (Output) Output vector. Modified.
-
jacobian
The cell is fixed, so a weight only moves through the fractions, and those are linear in the pixel- Specified by:
jacobianin interfaceCROperatorBackwardsJac<double[]>- Parameters:
dout- (Input) Jacobian of output conditional on this function, computed from next layer.jacobianInputs- (Output) Storage for all the Jacobian inputs. All matrices must be pre-declared and included in the list. If a matrix is marked as invalid, then the jacobian is skipped for that input.
-
setInput
Description copied from interface:CROperatorForwardSpecifies the value of an input's vector.
The implementation can safely save the array
inputpoints at along with its offset. Neither the values at that offset nor the array itself will change until afterCROperatorForward.forward(CRArray)or a derived function such asCROperatorBackwardsJac.jacobian(CRMatrix, List)has been called. Theinputreference itself cannot be saved: the caller is free to recycle theCRArraythe moment the call returns, including pointing it at another offset.- Specified by:
setInputin interfaceCROperatorForward<double[]>- Parameters:
which- Which inputinput- The input's value. This reference can't be saved internally but the array and offset can be.
-
getInputSize
public int getInputSize(int which) Description copied from interface:CROperatorForwardReturns the specified input's vector size- Specified by:
getInputSizein interfaceCROperatorForward<double[]>
-
getSettings
Description copied from interface:CROperatorForwardRetrieve a serialized description of the settings- Specified by:
getSettingsin interfaceCROperatorForward<double[]>
-
setSettings
Description copied from interface:CROperatorForwardReconfigures the block using the specified settings- Specified by:
setSettingsin interfaceCROperatorForward<double[]>
-
getInputCount
public int getInputCount()Description copied from interface:CROperatorForwardNumber of inputs- Specified by:
getInputCountin interfaceCROperatorForward<double[]>
-
getOutputSize
public int getOutputSize()Description copied from interface:CROperatorForwardReturns the output vector's size- Specified by:
getOutputSizein interfaceCROperatorForward<double[]>
-
getArrayType
Description copied from interface:CROperatorForwardPrimitive data type for the array- Specified by:
getArrayTypein interfaceCROperatorForward<double[]>
-