pub struct SpatialSoftmaxWithLossOp<T, Context> { /* private fields */ }
Expand description
| Combined Spatial Softmax and Cross-Entropy | loss operator. | | Similar to SoftmaxWithLoss, this operator | computes the spatial softmax normalized | values for each layer in the batch of | the given input, after which cross-entropy | loss is computed. | | This operator is numerically more stable | than separate Softmax and CrossEntropy | ops. | | The inputs are a 2-D tensor (Tensor) | of size (batch_size x input_feature_dimensions) | and tensor of labels (ground truth). | | Output is tensor with the probability | for each label in a pixel for each example | (N x D x W x H) and averaged loss (scalar). | | For spatial softmax, weighting is by | x,y position of the input. |
Implementations§
source§impl<T, Context> SpatialSoftmaxWithLossOp<T, Context>
impl<T, Context> SpatialSoftmaxWithLossOp<T, Context>
source§impl<T, Context> SpatialSoftmaxWithLossOp<T, Context>
impl<T, Context> SpatialSoftmaxWithLossOp<T, Context>
pub fn run_on_device_f32_cpu_context(&mut self) -> bool
Auto Trait Implementations§
impl<T, Context> !RefUnwindSafe for SpatialSoftmaxWithLossOp<T, Context>
impl<T, Context> !Send for SpatialSoftmaxWithLossOp<T, Context>
impl<T, Context> !Sync for SpatialSoftmaxWithLossOp<T, Context>
impl<T, Context> Unpin for SpatialSoftmaxWithLossOp<T, Context>where Context: Unpin, T: Unpin,
impl<T, Context> !UnwindSafe for SpatialSoftmaxWithLossOp<T, Context>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.