pub struct ValidPadding {
pub padding_amounts: Option<BorderAmounts>,
}Expand description
Specifies the type of padding to be used with Convolution/Deconvolution and Pooling layers.
After padding, input spatial shape: \[H_in, W_in\], gets modified to the
output spatial shape \[H_out, W_out\].
.. code::
topPaddingAmount == Height startEdgeSize == borderAmounts\[0\].startEdgeSize
bottomPaddingAmount == Height endEdgeSize == borderAmounts\[0\].endEdgeSize
leftPaddingAmount == Width startEdgeSize == borderAmounts\[1\].startEdgeSize
rightPaddingAmount == Width endEdgeSize == borderAmounts\[1\].endEdgeSizeWith Convolution or Pooling:
.. code::
H_out = int_division_round_down((H_in + topPaddingAmount + bottomPaddingAmount - KernelSize\[0\]),stride\[0\]) + 1which is same as:
.. code::
H_out = int_division_round_up((H_in + topPaddingAmount + bottomPaddingAmount - KernelSize\[0\] + 1),stride\[0\])With Deconvolution:
.. code::
H_out = (H_in-1) * stride\[0\] + kernelSize\[0\] - (topPaddingAmount + bottomPaddingAmount)The equivalent expressions hold true for W_out as well.
By default, the values of paddingAmounts are set to 0,
which results in a “true” valid padding.
If non-zero values are provided for paddingAmounts,
“valid” convolution/pooling is performed within the spatially expanded input.
Fields§
§padding_amounts: Option<BorderAmounts>Trait Implementations§
Source§impl Clone for ValidPadding
impl Clone for ValidPadding
Source§fn clone(&self) -> ValidPadding
fn clone(&self) -> ValidPadding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidPadding
impl Debug for ValidPadding
Source§impl Default for ValidPadding
impl Default for ValidPadding
Source§impl Message for ValidPadding
impl Message for ValidPadding
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for ValidPadding
impl PartialEq for ValidPadding
Source§fn eq(&self, other: &ValidPadding) -> bool
fn eq(&self, other: &ValidPadding) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ValidPadding
Auto Trait Implementations§
impl Freeze for ValidPadding
impl RefUnwindSafe for ValidPadding
impl Send for ValidPadding
impl Sync for ValidPadding
impl Unpin for ValidPadding
impl UnsafeUnpin for ValidPadding
impl UnwindSafe for ValidPadding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more