Struct juice::layers::common::pooling::Pooling [−][src]
pub struct Pooling<T, B: Pooling<T>> { /* fields omitted */ }
Expand description
Pooling Layer
Implementations
Create a Pooling layer from a PoolingConfig.
Trait Implementations
fn compute_input_gradient(
&self,
backend: &B,
_weights_data: &[&SharedTensor<f32>],
output_data: &[&SharedTensor<f32>],
output_gradients: &[&SharedTensor<f32>],
input_data: &[&SharedTensor<f32>],
input_gradients: &mut [&mut SharedTensor<f32>]
)
fn compute_input_gradient(
&self,
backend: &B,
_weights_data: &[&SharedTensor<f32>],
output_data: &[&SharedTensor<f32>],
output_gradients: &[&SharedTensor<f32>],
input_data: &[&SharedTensor<f32>],
input_gradients: &mut [&mut SharedTensor<f32>]
)
Compute gradients with respect to the inputs and write them into input_gradients
.
fn compute_output(
&self,
backend: &B,
weights: &[&SharedTensor<f32>],
input_data: &[&SharedTensor<f32>],
output_data: &mut [&mut SharedTensor<f32>]
)
fn compute_output(
&self,
backend: &B,
weights: &[&SharedTensor<f32>],
input_data: &[&SharedTensor<f32>],
output_data: &mut [&mut SharedTensor<f32>]
)
Compute output for given input and write them into output_data
.
fn compute_parameters_gradient(
&self,
backend: &B,
output_data: &[&SharedTensor<T>],
output_gradients: &[&SharedTensor<T>],
input_data: &[&SharedTensor<T>],
parameters_gradients: &mut [&mut SharedTensor<T>]
)
fn compute_parameters_gradient(
&self,
backend: &B,
output_data: &[&SharedTensor<T>],
output_gradients: &[&SharedTensor<T>],
input_data: &[&SharedTensor<T>],
parameters_gradients: &mut [&mut SharedTensor<T>]
)
Compute gradients with respect to the parameters and write them into parameters_gradients
.
Calculates the number of spatial dimensions for the pooling operation.
Calculate output shape based on the shape of filter, padding, stride and input.
The filter_shape that will be used by spatial_filter_dims
.
The stride that will be used by stride_dims
.
The padding that will be used by padding_dims
.
Computes the shape of the spatial dimensions.
Retrievs the spatial dimensions for the filter based on self.filter_shape()
and the number of spatial dimensions. Read more
Retrievs the stride for the convolution based on self.stride
and the number of spatial dimensions. Read more
Returns the exact number of output blobs required by the layer,
or None
if no exact number is required. Read more
Returns the exact number of input blobs required by the layer,
or None
if no exact number is required. Read more
fn reshape(
&mut self,
backend: Rc<B>,
input_data: &mut Vec<ArcLock<SharedTensor<f32>>>,
input_gradient: &mut Vec<ArcLock<SharedTensor<f32>>>,
weights_data: &mut Vec<ArcLock<SharedTensor<f32>>>,
weights_gradient: &mut Vec<ArcLock<SharedTensor<f32>>>,
output_data: &mut Vec<ArcLock<SharedTensor<f32>>>,
output_gradient: &mut Vec<ArcLock<SharedTensor<f32>>>
)
fn reshape(
&mut self,
backend: Rc<B>,
input_data: &mut Vec<ArcLock<SharedTensor<f32>>>,
input_gradient: &mut Vec<ArcLock<SharedTensor<f32>>>,
weights_data: &mut Vec<ArcLock<SharedTensor<f32>>>,
weights_gradient: &mut Vec<ArcLock<SharedTensor<f32>>>,
output_data: &mut Vec<ArcLock<SharedTensor<f32>>>,
output_gradient: &mut Vec<ArcLock<SharedTensor<f32>>>
)
Adjust to shapes of the output blobs to fit the shapes of the input blobs. Read more
Adjust size of shared workspace. Read more
Compute the [feedforward][1] layer output using the provided Backend. [1]: https://en.wikipedia.org/wiki/Feedforward_neural_network Read more
fn backward_input(
&self,
backend: &B,
weights_data: &[ArcLock<SharedTensor<f32>>],
output_data: &[ArcLock<SharedTensor<f32>>],
output_gradients: &[ArcLock<SharedTensor<f32>>],
input_data: &[ArcLock<SharedTensor<f32>>],
input_gradients: &mut [ArcLock<SharedTensor<f32>>]
)
fn backward_input(
&self,
backend: &B,
weights_data: &[ArcLock<SharedTensor<f32>>],
output_data: &[ArcLock<SharedTensor<f32>>],
output_gradients: &[ArcLock<SharedTensor<f32>>],
input_data: &[ArcLock<SharedTensor<f32>>],
input_gradients: &mut [ArcLock<SharedTensor<f32>>]
)
Compute the [backpropagation][1] input gradient using the provided backend. [1]: https://en.wikipedia.org/wiki/Backpropagation Read more
fn backward_parameters(
&self,
backend: &B,
output_data: &[ArcLock<SharedTensor<f32>>],
output_gradients: &[ArcLock<SharedTensor<f32>>],
input_data: &[ArcLock<SharedTensor<f32>>],
weights_gradients: &mut [ArcLock<SharedTensor<f32>>]
)
fn backward_parameters(
&self,
backend: &B,
output_data: &[ArcLock<SharedTensor<f32>>],
output_gradients: &[ArcLock<SharedTensor<f32>>],
input_data: &[ArcLock<SharedTensor<f32>>],
weights_gradients: &mut [ArcLock<SharedTensor<f32>>]
)
Compute the [backpropagation][1] parameters gradient using the provided backend. [1]: https://en.wikipedia.org/wiki/Backpropagation Read more
Return whether “anonymous” output blobs are created automatically for the layer. Read more
Returns the minimum number of output blobs required by the layer, or 0 if no minimum number is required. Read more
Return whether weight blobs are created automatically for the layer. Read more
Return whether to allow force_backward for a given input blob index. Read more
Return wether a simple native backend should be used to [sync][1] instead of the default backend. [1]: #method.sync Read more
Return wether the computations of a layer should be done in-place (the output will be written where the input was read from). Read more
Return wether the layer is a container. Read more
Return the associated loss weight for a given output blob index. Read more
Return the input tensors of the layer. Read more
Return the gradients of the input tensors of the layer. Read more
Return the output tensors of the layer. Read more
Return the gradients of the output tensors of the layer. Read more
Return the learnable weights inside the layer. Read more
Return the gradients for the learnable weights inside the layer. Read more
Return the names of the learnable weights inside the layer. Read more
Auto Trait Implementations
impl<T, B> RefUnwindSafe for Pooling<T, B> where
<B as NN<T>>::CPOOL: RefUnwindSafe,
impl<T, B> UnwindSafe for Pooling<T, B> where
<B as NN<T>>::CPOOL: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more