Trait juice::layers::common::FilterLayer[][src]

pub trait FilterLayer {
    fn calculate_output_shape(&self, input_shape: &[usize]) -> Vec<usize>;
fn num_spatial_dims(&self, input_shape: &[usize]) -> usize;
fn filter_shape(&self) -> &[usize]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
fn stride(&self) -> &[usize]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
fn padding(&self) -> &[usize]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
; fn calculate_spatial_output_dims(
        input_dims: &[usize],
        filter_dims: &[usize],
        padding: &[usize],
        stride: &[usize]
    ) -> Vec<usize> { ... }
fn spatial_filter_dims(&self, num_spatial_dims: usize) -> Vec<usize> { ... }
fn stride_dims(&self, num_spatial_dims: usize) -> Vec<usize> { ... }
fn padding_dims(&self, num_spatial_dims: usize) -> Vec<usize> { ... } }
Expand description

Provides common utilities for Layers that utilize a filter with stride and padding.

This is used by the Convolution and Pooling layers.

Required methods

Calculate output shape based on the shape of filter, padding, stride and input.

Calculates the number of spatial dimensions for the pooling operation.

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.

Provided methods

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.

The spatial dimensions only make up part of the whole filter shape. The other parts are the number of input and output feature maps.

Retrievs the stride for the convolution based on self.stride and the number of spatial dimensions.

Retrievs the padding for the convolution based on self.padding and the number of spatial dimensions.

Implementors