pub struct LTCCell<B: Backend> {Show 17 fields
pub gleak: Param<Tensor<B, 1>>,
pub vleak: Param<Tensor<B, 1>>,
pub cm: Param<Tensor<B, 1>>,
pub sigma: Param<Tensor<B, 2>>,
pub mu: Param<Tensor<B, 2>>,
pub w: Param<Tensor<B, 2>>,
pub erev: Param<Tensor<B, 2>>,
pub sensory_sigma: Param<Tensor<B, 2>>,
pub sensory_mu: Param<Tensor<B, 2>>,
pub sensory_w: Param<Tensor<B, 2>>,
pub sensory_erev: Param<Tensor<B, 2>>,
pub sparsity_mask: Param<Tensor<B, 2>>,
pub sensory_sparsity_mask: Param<Tensor<B, 2>>,
pub input_w: Option<Param<Tensor<B, 1>>>,
pub input_b: Option<Param<Tensor<B, 1>>>,
pub output_w: Option<Param<Tensor<B, 1>>>,
pub output_b: Option<Param<Tensor<B, 1>>>,
/* private fields */
}Expand description
Liquid Time-Constant (LTC) Cell
Fields§
§gleak: Param<Tensor<B, 1>>Leak conductance (must be positive)
vleak: Param<Tensor<B, 1>>Leak reversal potential
cm: Param<Tensor<B, 1>>Membrane capacitance (must be positive)
sigma: Param<Tensor<B, 2>>Sigmoid center parameter for internal synapses
mu: Param<Tensor<B, 2>>Sigmoid steepness parameter for internal synapses
w: Param<Tensor<B, 2>>Synaptic weights for internal synapses (must be positive)
erev: Param<Tensor<B, 2>>Reversal potentials for internal synapses (from wiring)
sensory_sigma: Param<Tensor<B, 2>>Sigmoid center parameter for sensory synapses
sensory_mu: Param<Tensor<B, 2>>Sigmoid steepness parameter for sensory synapses
sensory_w: Param<Tensor<B, 2>>Synaptic weights for sensory synapses (must be positive)
sensory_erev: Param<Tensor<B, 2>>Reversal potentials for sensory synapses (from wiring)
sparsity_mask: Param<Tensor<B, 2>>Sparsity mask for internal synapses (non-trainable)
sensory_sparsity_mask: Param<Tensor<B, 2>>Sparsity mask for sensory synapses (non-trainable)
input_w: Option<Param<Tensor<B, 1>>>Input weight for mapping
input_b: Option<Param<Tensor<B, 1>>>Input bias for mapping
output_w: Option<Param<Tensor<B, 1>>>Output weight for mapping
output_b: Option<Param<Tensor<B, 1>>>Output bias for mapping
Implementations§
Source§impl<B: Backend> LTCCell<B>
impl<B: Backend> LTCCell<B>
Sourcepub fn new(
wiring: &dyn Wiring,
sensory_size: Option<usize>,
device: &B::Device,
) -> Self
pub fn new( wiring: &dyn Wiring, sensory_size: Option<usize>, device: &B::Device, ) -> Self
Creates a new LTC Cell with the given wiring configuration
pub fn with_ode_unfolds(self, unfolds: usize) -> Self
pub fn with_epsilon(self, epsilon: f64) -> Self
Sourcepub fn with_input_mapping(self, mode: MappingMode, device: &B::Device) -> Self
pub fn with_input_mapping(self, mode: MappingMode, device: &B::Device) -> Self
Set input mapping mode (affine, linear, or none)
Sourcepub fn with_output_mapping(self, mode: MappingMode, device: &B::Device) -> Self
pub fn with_output_mapping(self, mode: MappingMode, device: &B::Device) -> Self
Set output mapping mode (affine, linear, or none)
pub fn state_size(&self) -> usize
pub fn motor_size(&self) -> usize
pub fn sensory_size(&self) -> usize
pub fn synapse_count(&self) -> usize
pub fn sensory_synapse_count(&self) -> usize
Sourcepub fn apply_weight_constraints(&mut self)
pub fn apply_weight_constraints(&mut self)
Apply weight constraints (clamp positive parameters to be >= 0)
Trait Implementations§
Source§impl<B> AutodiffModule<B> for LTCCell<B>
impl<B> AutodiffModule<B> for LTCCell<B>
Source§type InnerModule = LTCCell<<B as AutodiffBackend>::InnerBackend>
type InnerModule = LTCCell<<B as AutodiffBackend>::InnerBackend>
Source§fn valid(&self) -> Self::InnerModule
fn valid(&self) -> Self::InnerModule
Source§impl<B: Backend> Module<B> for LTCCell<B>
impl<B: Backend> Module<B> for LTCCell<B>
Source§type Record = LTCCellRecord<B>
type Record = LTCCellRecord<B>
Source§fn load_record(self, record: Self::Record) -> Self
fn load_record(self, record: Self::Record) -> Self
Source§fn into_record(self) -> Self::Record
fn into_record(self) -> Self::Record
Source§fn num_params(&self) -> usize
fn num_params(&self) -> usize
Source§fn visit<Visitor: ModuleVisitor<B>>(&self, visitor: &mut Visitor)
fn visit<Visitor: ModuleVisitor<B>>(&self, visitor: &mut Visitor)
Source§fn map<Mapper: ModuleMapper<B>>(self, mapper: &mut Mapper) -> Self
fn map<Mapper: ModuleMapper<B>>(self, mapper: &mut Mapper) -> Self
Source§fn collect_devices(&self, devices: Devices<B>) -> Devices<B>
fn collect_devices(&self, devices: Devices<B>) -> Devices<B>
Source§fn to_device(self, device: &B::Device) -> Self
fn to_device(self, device: &B::Device) -> Self
Source§fn fork(self, device: &B::Device) -> Self
fn fork(self, device: &B::Device) -> Self
Source§fn devices(&self) -> Vec<<B as Backend>::Device>
fn devices(&self) -> Vec<<B as Backend>::Device>
Source§fn save_file<FR, PB>(
self,
file_path: PB,
recorder: &FR,
) -> Result<(), RecorderError>
fn save_file<FR, PB>( self, file_path: PB, recorder: &FR, ) -> Result<(), RecorderError>
Source§fn load_file<FR, PB>(
self,
file_path: PB,
recorder: &FR,
device: &<B as Backend>::Device,
) -> Result<Self, RecorderError>
fn load_file<FR, PB>( self, file_path: PB, recorder: &FR, device: &<B as Backend>::Device, ) -> Result<Self, RecorderError>
Source§fn quantize_weights<C>(self, quantizer: &mut Quantizer<C>) -> Selfwhere
C: Calibration,
fn quantize_weights<C>(self, quantizer: &mut Quantizer<C>) -> Selfwhere
C: Calibration,
Source§impl<B: Backend> ModuleDisplay for LTCCell<B>
impl<B: Backend> ModuleDisplay for LTCCell<B>
Source§fn format(&self, passed_settings: DisplaySettings) -> String
fn format(&self, passed_settings: DisplaySettings) -> String
Source§fn custom_settings(&self) -> Option<DisplaySettings>
fn custom_settings(&self) -> Option<DisplaySettings>
Auto Trait Implementations§
impl<B> !Freeze for LTCCell<B>
impl<B> !RefUnwindSafe for LTCCell<B>
impl<B> Send for LTCCell<B>
impl<B> !Sync for LTCCell<B>
impl<B> Unpin for LTCCell<B>where
<B as Backend>::FloatTensorPrimitive: Unpin,
<B as Backend>::QuantizedTensorPrimitive: Unpin,
<B as Backend>::Device: Unpin,
impl<B> UnwindSafe for LTCCell<B>where
<B as Backend>::FloatTensorPrimitive: UnwindSafe,
<B as Backend>::QuantizedTensorPrimitive: UnwindSafe,
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
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>
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>
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