Struct neuronika::nn::Replicative [−][src]
pub struct Replicative;
Expand description
Replicative padding.
See .pad()
for more informations.
Trait Implementations
Pads the input array in place using the replication of its boundary.
See .pad()
for more informations.
Arguments
-
input
- array to be padded. -
original
- the original unpadded array. -
padding
- slice specifying the amount of padding for each dimension.
Panics
If padding
length doesn’t match input
’s dimensions.
Pads the input array using the replication of its boundary.
Only 1, 2 and 3 dimensional arrays support replicative padding.
Arguments
-
input
- the array to be padded. -
padding
- the amount of padding for each dimension.
Examples
use neuronika::nn::{Replicative, PaddingMode};
let padding = Replicative;
let arr = ndarray::array![
[1., 2., 3.],
[4., 5., 6.],
[7., 8., 9.]
];
let padded = padding.pad(&arr, (1, 1));
let result = ndarray::array![
[1., 1., 2., 3., 3.],
[1., 1., 2., 3., 3.],
[4., 4., 5., 6., 6.],
[7., 7., 8., 9., 9.],
[7., 7., 8., 9., 9.]
];
assert_eq!(padded, result);
Auto Trait Implementations
impl RefUnwindSafe for Replicative
impl Send for Replicative
impl Sync for Replicative
impl Unpin for Replicative
impl UnwindSafe for Replicative
Blanket Implementations
Mutably borrows from an owned value. Read more