pub struct FcLayer<T: Fn(f32) -> f32 + Clone, TD: Fn(f32) -> f32 + Clone> {
pub lr_params: CpuParams,
pub activation: Activation<T, TD>,
/* private fields */
}Fields§
§lr_params: CpuParams§activation: Activation<T, TD>Implementations§
Source§impl<T, TD> FcLayer<T, TD>
impl<T, TD> FcLayer<T, TD>
pub fn new(size: usize, activation: Activation<T, TD>) -> Self
pub fn new_box(size: usize, activation: Activation<T, TD>) -> Box<Self>
pub fn dropout(self, val: f32) -> Self
pub fn set_dropout(&mut self, val: f32)
pub fn l2_regularization(self, coef: f32) -> Self
pub fn set_l2_regularization(&mut self, coef: f32)
pub fn l1_regularization(self, coef: f32) -> Self
pub fn set_l1_regularization(&mut self, coef: f32)
Trait Implementations§
Source§impl<T, TD> AbstractLayer for FcLayer<T, TD>
impl<T, TD> AbstractLayer for FcLayer<T, TD>
Source§fn set_input_shape(&mut self, sh: &[usize])
fn set_input_shape(&mut self, sh: &[usize])
Carefull this method overwrites weights and all other params
fn forward(&mut self, input: ParamsBlob) -> LayerForwardResult
Source§fn backward(
&mut self,
prev_input: ParamsBlob,
next_input: ParamsBlob,
) -> LayerBackwardResult
fn backward( &mut self, prev_input: ParamsBlob, next_input: ParamsBlob, ) -> LayerBackwardResult
returns out_values and array of weights
fn cpu_params(&self) -> Option<CpuParams>
fn set_cpu_params(&mut self, lp: CpuParams)
fn layer_type(&self) -> &str
fn size(&self) -> usize
fn copy_layer(&self) -> Box<dyn AbstractLayer>
fn clone_layer(&self) -> Box<dyn AbstractLayer>
fn forward_input(&mut self, _input_data: Array2D) -> LayerForwardResult
fn backward_output( &mut self, _prev_input: ParamsBlob, _expected: Array2D, ) -> LayerBackwardResult
fn set_batch_size(&mut self, batch_size: usize)
fn metrics(&self) -> Option<&Metrics>
fn serializable_bufs(&self) -> &[i32]
fn trainable_bufs(&self) -> TrainableBufsIds<'_>
Auto Trait Implementations§
impl<T, TD> Freeze for FcLayer<T, TD>
impl<T, TD> !RefUnwindSafe for FcLayer<T, TD>
impl<T, TD> !Send for FcLayer<T, TD>
impl<T, TD> !Sync for FcLayer<T, TD>
impl<T, TD> Unpin for FcLayer<T, TD>
impl<T, TD> !UnwindSafe for FcLayer<T, TD>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more