pub struct ConvolutionLayer<F>where
F: Float,{ /* private fields */ }Expand description
Rust implementation of a convolutional layer. The weight matrix shall have dimension (in that order) (input channels, output channels, kernel width, kernel height), to comply with the order in which pytorch weights are saved.
Implementations§
Source§impl<F> ConvolutionLayer<F>
impl<F> ConvolutionLayer<F>
Sourcepub fn new(
weights: ArrayBase<OwnedRepr<F>, Dim<[usize; 4]>>,
bias_array: Option<ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>>,
stride: usize,
padding: Padding,
) -> ConvolutionLayer<F>
pub fn new( weights: ArrayBase<OwnedRepr<F>, Dim<[usize; 4]>>, bias_array: Option<ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>>, stride: usize, padding: Padding, ) -> ConvolutionLayer<F>
Creates new convolution layer. The weights are given in Pytorch layout. (out channels, in channels, kernel height, kernel width) Bias: (output height * output width, 1)
Sourcepub fn new_tf(
weights: ArrayBase<OwnedRepr<F>, Dim<[usize; 4]>>,
bias_array: Option<ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>>,
stride: usize,
padding: Padding,
) -> ConvolutionLayer<F>
pub fn new_tf( weights: ArrayBase<OwnedRepr<F>, Dim<[usize; 4]>>, bias_array: Option<ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>>, stride: usize, padding: Padding, ) -> ConvolutionLayer<F>
Creates new convolution layer. The weights are given in Tensorflow layout. (kernel height, kernel width, in channels, out channels)
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for ConvolutionLayer<F>
impl<F> RefUnwindSafe for ConvolutionLayer<F>where
F: RefUnwindSafe,
impl<F> Send for ConvolutionLayer<F>where
F: Send,
impl<F> Sync for ConvolutionLayer<F>where
F: Sync,
impl<F> Unpin for ConvolutionLayer<F>
impl<F> UnsafeUnpin for ConvolutionLayer<F>
impl<F> UnwindSafe for ConvolutionLayer<F>where
F: RefUnwindSafe,
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