Function that takes an input X and outputs (A + B*X)^N. Cog has two pow() function signatures corresponding to both integer and non-integer powers. The integer case for N is detected here and special-cased (instead of having a separate node for this).
A bias transformation that adds bias weights to the input signal
A bias transformation that adds bias weights to the input signal
The input signal
The bias weights
Flag for sharing bias across the input field. Sharing bias causes the
bias to be applied uniformly across the field points of the input and
requires that weights
has a 0D field shape. Unshared bias applies a different
bias to each field point and requires weights
to have the same field shape as input
.
The cross-entropy loss function applied to the softmax of the input relative to the reference signal.
The cross-entropy loss function applied to the softmax of the input relative to the reference signal. This loss function is commonly used for training a classification network.
The input signal, typically a classification output
The reference signal, typically a one hot code representing a class label
The cross-entropy loss function applied to the softmax of the input relative to the reference signal.
The cross-entropy loss function applied to the softmax of the input relative to
the reference signal. This loss function is commonly used for training a classification
network. Unlike the similarly-named "CrossEntropySoftMax", this class computes
a cross-entropy softmax individually for each image representation of the batch. As
such, its output is not a single scalar, but instead a vector of length batchSize
.
This allows the class to be tested by the existing test infrastructure.
The input signal, typically a classification output
The reference signal, typically a one hot code representing a class label
The right
reference input for each element of the batch sums to 1.
Protect against generating NaNs for large inputs (>100).
The downsample operator which samples every factor
input element to produce a reduced size output.
The downsample operator which samples every factor
input element to produce a reduced size output.
The outputSize = ceil(inputSize / factor).
Decided not to expose the "phase" parameter that exists with Cog's core downsample/upsample operators. There are some subtleties present in the Cog API, namely phase <= inSize-1 % factor. Put a different way, the Cog core's downsample() will result in a field of size ceil(inSize/factor). The specification of a non-zero phase should not disturb that. (inSize, factor, phase) = (5, 3, 2) is such a problem case where one might assume an output of size 1, but Cog will generate a size of 2.
input signal
the factor by which the output is reduced
The max pooling function with a poolSize
x poolSize
input field stepped by stride
.
The max pooling function with a poolSize
x poolSize
input field stepped by stride
. The input
must be two dimensional.
The ability to accomodate overlapping pools (where poolSize != stride) adds considerable complexity. In particular, the jacobianAdjoint must be prepared to sum multiple gradients (dY's) because of the potential spraying of values in the forward direction. Thus, there are two different implementation strategies taken for the two cases:
Overlapped pools: The jacobianAdjoint GPUOperator allocates one thread per element of the larger 'dX' field that it generates to more naturally handle the summing that might occur into each such element. For performance, the jacobianAdjoint GPUOperator assumes and reads in a gradient-sized "index field" that contains the field offset of the input that is the maximum of the pool. The forward operator leverages the existence of the "index field" to generate its output as well.
Non-overlapping pools: The jacobianAdjoint GPUOperator allocates one thread per element of the gradient 'dY' field and has that thread write the dY value to the appropriate 'dX' field element (no summing required). Since no "index field" is needed to help speed the jacobianAdjoint, the forward operator examines its input tile and outputs the maximum in a straightforward manner.
The current approach might run faster by using local memory, but at the risk of not being able to accommodate large strides..
input signal
the edge size of the square pooling window, defaults to 2
the amount by which the pooling window is stepped (in both x and y), defaults to 2
Crop an N-dimensional input from the "right" (the highest-indexed data in each dimension).
Crop an N-dimensional input from the "right" (the highest-indexed data in each dimension).
the input signal
the amount of padding to remove for all dimensions
Pad an N-dimensional input with zeros on the "right" (after the data in each dimension)
Pad an N-dimensional input with zeros on the "right" (after the data in each dimension)
the input signal
the amount of padding to add for all dimensions
The softmax (multinomial logistic regression).
The softmax (multinomial logistic regression). Converts the input to a form that could be considered a discrete probability distribution- i.e. all positive values that sum to 1.
The input signal, typically a classification output.
Protect against generating NaNs for large inputs (>100).
A convolutional transformation that applies a filter bank to a signal in the space domain.
A convolutional transformation that applies a filter bank to a signal in the space domain.
The signal node
The filter bank input, typically a TrainableState field
The factor by which the output with be downsampled after the BorderValid convolution
Binary compute node that stacks fields in the feature vector domain.
Binary compute node that stacks fields in the feature vector domain. Both inputs must have the same field shape.
first input signal
second input signal, stacked on the first in the vector domain
Pull a contiguous region out of a field.
Pull a contiguous region out of a field.
the input signal
the ranges of interest of the input field, e.g. Seq(rowRanges, columnRanges)
The function a*tanh(b*x) applied at each point
The function a*tanh(b*x) applied at each point
the input signal
scale parameter
gain parameter
Pad an input with zeros.
Pad an input with zeros.
the input signal
pad size, in field points
Helper function object for creating a convolutional Compute
Node
along with its associated State
Function that takes an input X and outputs (A + B*X)^N. Cog has two pow() function signatures corresponding to both integer and non-integer powers. The integer case for N is detected here and special-cased (instead of having a separate node for this).
If N is other than a positive integer, be aware that you may need to ensure that the A + B*X term is always positive to avoid NaNs from killing the model state.
the input signal
a constant offset added to the input
a constant multiplier that scales the input
the power to raise the input to