added skeleton code for leaky
Some checks failed
/ Tests (push) Failing after 3m51s

This commit is contained in:
2026-04-10 13:20:13 +05:30
parent de3f3990ee
commit 6a31330001

View File

@@ -1,14 +1,24 @@
use burn::{Tensor, module::Module, prelude::Backend}; use burn::{Tensor, module::Module, prelude::Backend, tensor::backend::AutodiffBackend};
#[derive(Debug, Module, Clone, Default)] #[derive(Debug, Module)]
pub struct LIF; pub struct LIF<B: Backend> {
pub v: Tensor<B, 1>,
}
impl LIF { impl<B: Backend> LIF<B> {
pub fn new() -> Self { pub fn new(device: &B::Device) -> Self {
Self Self {
v: Tensor::zeros([1], device),
} }
}
pub fn forward<B: Backend, const D: usize>(&self, input: Tensor<B, D>) -> Tensor<B, D> { }
input
impl<B: AutodiffBackend> LIF<B> {
pub fn forward(&mut self, input: Tensor<B, 2>) -> Tensor<B, 2> {
input
}
pub fn backward(&mut self, x: Tensor<B, 2>) -> Tensor<B, 2> {
x
} }
} }