From 6a3133000168303c80faf46371ce704a52a1f3d2 Mon Sep 17 00:00:00 2001 From: Phani Pavan K Date: Fri, 10 Apr 2026 13:20:13 +0530 Subject: [PATCH] added skeleton code for leaky --- src/neurons/leaky.rs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/neurons/leaky.rs b/src/neurons/leaky.rs index 778738d..426a694 100644 --- a/src/neurons/leaky.rs +++ b/src/neurons/leaky.rs @@ -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)] -pub struct LIF; +#[derive(Debug, Module)] +pub struct LIF { + pub v: Tensor, +} -impl LIF { - pub fn new() -> Self { - Self - } - - pub fn forward(&self, input: Tensor) -> Tensor { - input +impl LIF { + pub fn new(device: &B::Device) -> Self { + Self { + v: Tensor::zeros([1], device), + } + } +} + +impl LIF { + pub fn forward(&mut self, input: Tensor) -> Tensor { + input + } + + pub fn backward(&mut self, x: Tensor) -> Tensor { + x } }